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 


Weird Results - Never Seen This Before

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Mon Sep 29, 2008 6:29 pm    Post subject: Weird Results - Never Seen This Before Reply with quote

I do alot of processing of files in VDS (version 5) and I ran into something today that I don't understand and am hoping somebody can shed some light on it so I can figure out what i need to do to fix this.

I have a text file (file.txt) that contains the following:

"192.168.0.2","192.168.0.50","ARTCC A&MC"

I do the following in VDS

option fieldsep,@chr(44)
list create,1
list loadfile,1,@path(%0)file.txt
%%total = @count(1)
%%fileline = 0
REPEAT
%%item = @next(1)
%%fileline = @succ(%%fileline)
UNTIL @equal(%%fileline,%%total)
list close,1

Now when I do an info %%item it only shows the following.
"192.168.0.2","192.168.0.50","ARTCC

So basically everything BEFORE the space is shown. Any suggestions on how I can return the entire line in the file?

Thanks

First time I ever ran into this.

Kevin

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Mon Sep 29, 2008 6:44 pm    Post subject: Reply with quote

Try this and see if there's any difference:

Code:
option fieldsep,@chr(44)
list create,1
list loadfile,1,@path(%0)file.txt
%%total = @count(1)
%%fileline = 0
REPEAT
  %%item = @item(1)
  %%null = @next(1)
  %%fileline = @succ(%%fileline)
UNTIL @equal(%%fileline,%%total)
list close,1


I'm not sure, but it may be that because you're not actually asking for the info in the list, but advancing it by using @next() instead of @item(), that you're getting bad results. Try the above with the @item() actually asking for the info, and the @next() on the line after with a blank variable for simply advancing to the next line in the list. See if that does anything.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Mon Sep 29, 2008 6:52 pm    Post subject: No Dice Reply with quote

Its weird as now I am getting an invalid list option. Not exactly sure what is happening as I have not seen VDS behave like this before.

Im not really sure how to resolve the issue either. I have done this many times without ever running into any issues. In fact earlier in the same program I do it. Maybe i'll do it with a list instead of ever writing it to a file and see if that changes the behaviour in any way.

Kevin

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Mon Sep 29, 2008 10:26 pm    Post subject: Whoops Sorry Reply with quote

Well it turns out that it was a WINE issue (Yes WINE as in the Windows emulator under Linux). I have been developing code on my Linux box because it runs very quick and I can do all of my development (Linux and Windows) on it without restarting my workstation. However after moving the code to a Windows box it appears as though its an issue is with WINE so I apologize for bothering the forum......

So if anybody is using WINE (doubtful) to do VDS coding keep in mind that it affects some of the commands. It also breaks the parse command. If a string has a space in it the results will not be what you are expecting.

Commands Affected:
@next
@item
parse

If your using string.dll it will work under Linux but also exhibits the same behaviour. If the string you are manipulating has a space anything after the space gets cut off.

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Mon Sep 29, 2008 10:53 pm    Post subject: Reply with quote

Your program runs for me right!
You can try rem (or #) lines with REPEAT and UNTIL commands.
If it helps and the whole text appears, an error could be in some unintenional control characters at the end of your file. (e.g. some text editors do it)

_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
JerryDee
Contributor
Contributor


Joined: 19 Oct 2005
Posts: 53
Location: Czech Republic

PostPosted: Mon Sep 29, 2008 10:56 pm    Post subject: Reply with quote

Sorry, I too long wrote my contribution ... Very Happy
_________________
Jerry
(VDS 4,5,6 Pro | V-Setup 3)
Back to top
View user's profile Send private message Send e-mail
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Tue Sep 30, 2008 4:52 am    Post subject: Reply with quote

One other problem I didn't realize, you need a list seek,1,0 right after you load the file.

So

Code:
option fieldsep,@chr(44)
list create,1
list loadfile,1,@path(%0)file.txt
list seek,1,0
%%total = @count(1)
%%fileline = 0
REPEAT
  %%item = @item(1)
  %%null = @next(1)
  %%fileline = @succ(%%fileline)
UNTIL @equal(%%fileline,%%total)
list close,1


try that now. Just maybe that's part of the problem there.

_________________
'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.)
Back to top
View user's profile Send private message
DanKegel
Newbie


Joined: 30 Sep 2008
Posts: 1

PostPosted: Tue Sep 30, 2008 1:18 pm    Post subject: Wine and VDS Reply with quote

webdaddy wrote:

So if anybody is using WINE (doubtful) to do VDS coding keep in mind that it affects some of the commands. It also breaks the parse command. If a string has a space in it the results will not be what you are expecting.

Commands Affected:
@next
@item
parse

If your using string.dll it will work under Linux but also exhibits the same behaviour. If the string you are manipulating has a space anything after the space gets cut off.


I've added a Wine Apdb entry for this app, see
http://appdb.winehq.org/objectManager.php?sClass=version&iId=13983

Can you attach a script there that demonstrates the problem? Maybe we can fix it.

Thanks!
Back to top
View user's profile Send private message Send e-mail
webdaddy
Contributor
Contributor


Joined: 14 Nov 2004
Posts: 151
Location: Raleigh NC

PostPosted: Wed Oct 01, 2008 7:42 pm    Post subject: Wine App DB Reply with quote

I went ahead and added it to the database. I will do some testing to see if I can figure out why it happens and see how it can be fixed.

Kevin

_________________
K Wetzel
Programming - Technology - Communications
"The Home of the SLC Security Console"
SLC now available for Linux...
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
vdsalchemist
Admin Team


Joined: 23 Oct 2001
Posts: 1448
Location: Florida, USA

PostPosted: Fri Oct 03, 2008 3:50 pm    Post subject: Re: Whoops Sorry Reply with quote

webdaddy wrote:
Well it turns out that it was a WINE issue (Yes WINE as in the Windows emulator under Linux). I have been developing code on my Linux box because it runs very quick and I can do all of my development (Linux and Windows) on it without restarting my workstation. However after moving the code to a Windows box it appears as though its an issue is with WINE so I apologize for bothering the forum......

So if anybody is using WINE (doubtful) to do VDS coding keep in mind that it affects some of the commands. It also breaks the parse command. If a string has a space in it the results will not be what you are expecting.

Commands Affected:
@next
@item
parse

If your using string.dll it will work under Linux but also exhibits the same behaviour. If the string you are manipulating has a space anything after the space gets cut off.


It appears that WINE is not respecting the quotes? You can also try replacing the space @chr(32) with a space @chr(160)... this would be a pain but it may be a work around since it would use the upper bits of a ASCII character. Remember that Unix and Linux are Big endian where Windows is little endian...

_________________
Home of

Give VDS a new purpose!
Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
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