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 


LIST LOADFILE question
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
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 1:08 am    Post subject: LIST LOADFILE question Reply with quote

hello

i have been playing with the LIST LOADFILE it works ok BUT i notice if you have a text box that display what is in the txt file you load and if the txt file has more then one line of text in it. It don't display it in the text box Sad is there a way to have it display ONE line at a time then clear it then read second line of txt file,etc and have it display this in the text box? also to AS it reads each line of the text file have it store this to a var.
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 1:22 am    Post subject: and Reply with quote

also to i see LIST LOADFILE don't like var... Sad that or i'am doing somethimg wrong Smile
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 3:22 am    Post subject: Reply with quote

I don't quite understand what you are trying to do by loading the text one line at a time.

As far as list loadfile,... not liking variables, I ususlly have to use the @shortname() function.

Post an example for me. Smile

Bill

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 3:32 am    Post subject: Reply with quote

You might want to look at this topic also:

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

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 3:43 am    Post subject: ok Reply with quote

ok i have it reading one line at a time BUT if i have a big file it only read the first line then it stops Sad and the var problem i will work on that after i get it to read the whole file

here is what i have

this code here i have so i can see it read the txt file line by line ( this is in my dilalog window
Code:

 DIALOG ADD,LIST,tim,170,0,552,22



then i have this code THAT READS small txt file fine but when i have a big txt file it reads the first line then stops Sad


Code:

:button1button
LIST CREATE,tim
list clear,tim
list loadfile,tim, c:\test.txt
 list seek,tim,0
  repeat
    %A = @next(tim)
    IF %A
   dialog cursor,%A
   wait 1
 END
  until @null(%A)



thanks
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 3:50 am    Post subject: grrrrrrrrrrrrrr Reply with quote

i know why it stops Sad

cuase if you have spaces in the txt file meaning this:

tim

tim 1

tim 2

it stops on the spaces Sad any way to fix that so it reads the spaces?

thanks
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 3:51 am    Post subject: Reply with quote

Tim wrote:
Code:
:button1button
LIST CREATE,tim
list clear,tim
list loadfile,tim, c:\test.txt
list seek,tim,0
  repeat
    %A = @next(tim)
    IF %A
   dialog cursor,%A
   wait 1
END
  until @null(%A)


Here's the way I'd do this:
Code:

:Button1BUTTON
  list create,1
  list loadfile,1,C:\Text.txt
  if @greater(@count(1),0)
    %x = 0
    repeat
      list seek,1,%x
      %A = @item(1)
      if @not(@null(%A))
        dialog cursor,%A
        wait 1
      else
        dialog cursor
      end
      %x = @succ(%x)
    until @equal(%x,@count(1))
  end
  list close,1
  goto Evloop


Does this help? Smile Question

Bill

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 3:53 am    Post subject: Reply with quote

What do you mean read spaces? If the empty string only contains spaces do something or not do something?
_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 3:55 am    Post subject: yea Reply with quote

if there are spaces in the txt info..is there a way to have it skip the space so it won't stop?
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 3:56 am    Post subject: Reply with quote

if you use %A = @trim(@item(1)), it will return the text without the return or any preceeding spaces up to the first letter in the list item.
_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 3:59 am    Post subject: Reply with quote

Code:

:Button1BUTTON
  list create,1
  list loadfile,1,C:\Text.txt
  if @greater(@count(1),0)
    %x = 0
    repeat
      list seek,1,%x
      %A = @trim(@item(1))
      if @not(@null(%A))
        dialog cursor,%A
        wait 1
      else
        dialog cursor
      end
      %x = @succ(%x)
    until @equal(%x,@count(1))
  end
  list close,1
  goto Evloop


I'm afraid that's all I can come up with. I thought about checking %A to see if it had @chr(32) in it but that would be a bad thing because there is always the possibility of having a @chr(32) in a line of text.

If you are creating the text file, just omit the empty lines.

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."


Last edited by ShinobiSoft on Mon Nov 25, 2002 4:06 am; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 4:04 am    Post subject: hummmm Reply with quote

hummm i added that line like you say and it still stops BUT it stops on a line that DON't have spaces next Sad

i look thru the txt file and some of the data is like this:


tim 1

tim2
tim3
tim3

tim4
Back to top
View user's profile Send private message
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 4:08 am    Post subject: yea Reply with quote

txt file is made by other non-vds program Sad
Back to top
View user's profile Send private message
ShinobiSoft
Professional Member
Professional Member


Joined: 06 Nov 2002
Posts: 790
Location: Knoxville, Tn

PostPosted: Mon Nov 25, 2002 4:12 am    Post subject: Reply with quote

The only other thing I can think of is to loop through the whole file looking for @cr()'s @chr(9) and removing them with @strdel() before looping through the file to view it's contents.

Maybe someone else has a better idea!? Confused Sad

_________________
Bill Weckel
ShinobiSoft Software

"The way is known to all, but not all know it."
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger
tim6389
Professional Member
Professional Member


Joined: 01 Aug 2002
Posts: 790

PostPosted: Mon Nov 25, 2002 4:18 am    Post subject: i got it workimng :) Reply with quote

i got it working Smile now

how to make LIST LOADFILE work with varibles? meaning this




LIST LOADFILE ,tim, %T


thanks
Back to top
View user's profile Send private message
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