| View previous topic :: View next topic |
| Author |
Message |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Mon Sep 29, 2008 6:29 pm Post subject: Weird Results - Never Seen This Before |
|
|
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 |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Mon Sep 29, 2008 6:44 pm Post subject: |
|
|
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 |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Mon Sep 29, 2008 6:52 pm Post subject: No Dice |
|
|
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 |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Mon Sep 29, 2008 10:26 pm Post subject: Whoops Sorry |
|
|
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 |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Mon Sep 29, 2008 10:53 pm Post subject: |
|
|
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 |
|
 |
JerryDee Contributor


Joined: 19 Oct 2005 Posts: 53 Location: Czech Republic
|
Posted: Mon Sep 29, 2008 10:56 pm Post subject: |
|
|
Sorry, I too long wrote my contribution ...  _________________ Jerry
(VDS 4,5,6 Pro | V-Setup 3) |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Sep 30, 2008 4:52 am Post subject: |
|
|
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 |
|
 |
DanKegel Newbie
Joined: 30 Sep 2008 Posts: 1
|
Posted: Tue Sep 30, 2008 1:18 pm Post subject: Wine and VDS |
|
|
| 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 |
|
 |
webdaddy Contributor


Joined: 14 Nov 2004 Posts: 151 Location: Raleigh NC
|
Posted: Wed Oct 01, 2008 7:42 pm Post subject: Wine App DB |
|
|
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 |
|
 |
vdsalchemist Admin Team

Joined: 23 Oct 2001 Posts: 1448 Location: Florida, USA
|
Posted: Fri Oct 03, 2008 3:50 pm Post subject: Re: Whoops Sorry |
|
|
| 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 |
|
 |
|