forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Load textfile into EDIT and keeping format?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 12:27 pm    Post subject: Load textfile into EDIT and keeping format? Reply with quote

Maybe someone could help me with a simple solution to loading a textfile (in Windows format) into a variable so I can use it in a EDIT object and keeping it's formatting. By that I mean, keeping the tabs and linebreaks.

Hope someone can help me with this Razz

PS! I'm using the following formatting on the EDIT object: WRAP,MULTI,SCROLL,READONLY

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Feb 26, 2003 12:35 pm    Post subject: Reply with quote

Code:

LIST CREATE, 1
LIST LOADFILE, 1, "C:\whatever.txt"
DIALOG SET, Edit1, @text(1)


Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 12:36 pm    Post subject: Reply with quote

Thanks alot Mac. Worked perfectly Wink
_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Feb 26, 2003 12:46 pm    Post subject: Reply with quote

No prob, Wink

Ya might wanna check this VDS editor code for some edit
control tricks such as line count, etc. Wink

http://www.vdsworld.com/forum/viewtopic.php?t=120

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 12:49 pm    Post subject: Reply with quote

Wow, very nice code Mac.
Is it free to use?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Feb 26, 2003 12:59 pm    Post subject: Reply with quote

I think all code posted on this forum is free to use, as long as you put a 'Thanks to: ' in your about window... Wink
Back to top
View user's profile Send private message
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Feb 26, 2003 1:01 pm    Post subject: Reply with quote

All my posted code is free to use - however, that example is
not entirely mine.

Julian Moss is the original author, and here's what he had in
the original code (note the pun on "share" ware):

REM A program by Julian Moss -- 9th March 1999
REM ----------------------------------------
REM This demonstration application is share-ware.
REM If you make improvements to it, that illustrate other
REM useful techniques, please share them with others by
REM helping us to publish updates for this program.


I think any posted code is free (unless otherwise noted), but I'm
sure most folks would appreciate a mention if ya use their code
extensively though. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 1:05 pm    Post subject: Reply with quote

Thanks for the info Skit Smile

BTW, I now get an error in my code. It's an errorcode 4 which from the helpfile:

Quote:
4 Invalid list operation

The string list or list box control referenced in this command does not exist..

Copyright © 1995 - 2002 S.A.D.E. s.a.r.l. / All rights are reserved.


What does that mean?
I've checked that the object name is correct. It happens when I click between the tabs in my program. Any ideas? I'm using the code Mac put earlier.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Wed Feb 26, 2003 1:06 pm    Post subject: Reply with quote

Maybe you've hidden the element? Don't know if things like @match() are still working on hidden elements...
Back to top
View user's profile Send private message
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 1:07 pm    Post subject: Reply with quote

Just a note on my post above, I've got the load list code by Mac twice in my program.

On the second list I changed the number 1 to 2.

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 1:11 pm    Post subject: Reply with quote

Another note, it only appears to crash when I click the same tab twice. The first time I click the CREDTIS tab, then it's ok, then I click the About tab and back to the Credits tab that's when it crashes.

Do I have to empty the list or something before reload?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 1:17 pm    Post subject: Reply with quote

It's working now.
Thanks to Skit 3000 who told me to add LIST CLOSE,1 before Goto Evloop

Wink thanks guys

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Feb 26, 2003 1:27 pm    Post subject: Reply with quote

You can also put LIST CREATE, 1 at the start of your program,
then just use LIST CLEAR, 1 to empty it as needed. You don't
have to empty it when using LOADFILE, ASSIGN, etc. - they
replace the contents (if there are any). Wink

Using LIST CREATE, 1 tries to re-create the same list if
ya use again it without closing the list. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
GeoTrail
Valued Contributor
Valued Contributor


Joined: 18 Feb 2003
Posts: 572
Location: Bergen, Norway

PostPosted: Wed Feb 26, 2003 1:34 pm    Post subject: Reply with quote

Thanks for the tip Mac.
Is that faster or takes up less memory?

_________________
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Mac
Professional Member
Professional Member


Joined: 08 Jul 2000
Posts: 1585
Location: Oklahoma USA

PostPosted: Wed Feb 26, 2003 1:42 pm    Post subject: Reply with quote

Prolly not much difference if ya don't leave a list full of
data ya don't need. Wink

Using LIST CLOSE will free up a tiny bit of memory that's set
aside for list creation, but leaving the list and clearing it is prolly
more efficient if you're gonna re-use the list all thru the program. Wink

Cheers, Mac Smile

_________________
VDSug.dll does file IO, check/disable menu items,
non-VDS dlls, draw functions and more...
Free download (30k dll size) at:
http://www.vdsworld.com/download.php?id=361
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group