| View previous topic :: View next topic |
| Author |
Message |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Sep 24, 2002 3:35 pm Post subject: vdsdll.dll Bug or VDS Bug ??? |
|
|
| Code: |
external @path(%0)vdsdll.dll
%%user = @dll(util,username)
INIFILE OPEN,users.ini
%%GRP = @INIREAD(%%user,Group)
%%CAD = @INIREAD(%%user,CAD)
%%HIDE = @INIREAD(%%user,Hide)
%%CLOSE = @INIREAD(%%user,Close)
|
The above variable %%user returns: Nathan Clarke
The inifile user.ini is structed like this:
[Nathan Clarke]
Group=student
CAD=1
Hide=
Close=No
When it is reading %%grp, %%cad it returns nothing ????
Any ideas..
Nathan |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Tue Sep 24, 2002 3:38 pm Post subject: |
|
|
| Use a path @path(%0)users.ini on you're inifile open command otherwise I think it tries to create/read the inifile from the windows/system directory. |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Sep 24, 2002 3:41 pm Post subject: Nope did not work !!! |
|
|
I tried that PGWARE, still no result
Nathan |
|
| Back to top |
|
 |
Tommy Admin Team
Joined: 16 Nov 2002 Posts: 746 Location: The Netherlands
|
Posted: Tue Sep 24, 2002 3:46 pm Post subject: |
|
|
Try "inifile open,.\users.ini", otherwise it'll probably try to load the inifile from the Windows
directory in which such a file doesn't exist. This way it will load the inifile from the current
directory.
Edit:
Oops, I didn't notice PK already replied with something similar.
Last edited by Tommy on Tue Sep 24, 2002 4:59 pm; edited 1 time in total |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Sep 24, 2002 3:52 pm Post subject: |
|
|
I'll tell you what i am trying to do:
retrieve the current users name and then open a file so that there preferences can be applied.
I tried:
external @path(%0)vdsdll.dll
%%user = @dll(util,username)
list create,1
list loadfile,1,%%user.txt
etc
etc
But VDS could not open Nathan Clarke.txt
Is there any way to do this?? |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Tue Sep 24, 2002 3:56 pm Post subject: |
|
|
Change it to >
| Code: |
list loadfile,1,%%users".txt"
|
You should always put normal text that is right after a variable in parantheses when there is no space in between, otherwise vds thinks you are trying to access the variable %%users.txt and that variable doesn't exist but %%users does. |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Tue Sep 24, 2002 4:11 pm Post subject: |
|
|
I'm tearing my hair out, whats left of it anyway.
I can't get this thing to work.
I want to retrieve the current username.
Then open a text file eg.
%%curuser = Nathan Clarke
Open file into a list
list loadfile,whatever,Nathan Clarke.txt
I just can't get this to work !!
If i manual put in Nathan Clarke it works ! But I want VDS or vdsdll.dll to retreive the username because it will change. |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Wed Sep 25, 2002 3:16 am Post subject: |
|
|
| Code: |
external @path(%0)vdsdll.dll
%%user = @dll(util,username)
info @len(%%user)
list create,1
list add,1,%%user
list savefile,1,@path(%0)%%user.txt
|
This script works perfectly fine on my pc...running win98 vds3.5 using vdsdll version 3.17.0.0 which I DL'd from sools.com just to help you
The only thing I can think of wrong with your original script is not your original script, it's the DLL, or the windows version your working with.
Windows xp and 2000/nt handle things a bit differently than me/98/95, so if your using one of those that might be it.
My other thought is that you should REALLY CHECK the VDSDLL in your directory and make sure it is version 3.x, there are a few different vdsdll's on my pc, maybe you popped the wrong one in the directory by mistake.
The len function is there to see if maybe your windows version is returning leading or trailing spaces.... just a thought.
NodNarb |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Wed Sep 25, 2002 4:33 am Post subject: |
|
|
A good way to debug what is happening to you're variables is to see them before they perform any action.
Do this before you use the LIST LOADFILE command>
You can use the warn %%user also in a few other places to see where the variable is ending up going wrong. This will let you see why you're variable has changed or if there is nothing wrong with it at all. |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Sep 25, 2002 8:21 am Post subject: |
|
|
I think I found the BUG:
I am using Windows XP and VDS 4.5
vdsdll.dll version 3.17
When I use this Command !
| Code: |
external @path(%0)vdsdll.dll
%%user = @dll(util,username)
info @len(%%user)
|
The value returned is : 14
My username is: Nathan Clarke
And when I do:
| Code: |
info @len(Nathan Clarke)
|
It returns : 13 ????
Anyone any ideas ?????
The dll is added an extra Space like below:
Nathan Clarke (when is meant to be)
Nathan Clarke
????? Weird ????? |
|
| Back to top |
|
 |
SnarlingSheep Professional Member


Joined: 13 Mar 2001 Posts: 759 Location: Michigan
|
Posted: Wed Sep 25, 2002 8:31 am Post subject: |
|
|
Not sure why it'd do that, but you should be able to use @TRIM to fix it. _________________ -Sheep
My pockets hurt... |
|
| Back to top |
|
 |
Rubes_sw Valued Contributor


Joined: 11 Jun 2001 Posts: 625 Location: Northern Ireland
|
Posted: Wed Sep 25, 2002 10:01 am Post subject: SO SORRY :) |
|
|
I sorry,
I messed up, I checked the registry and in the registry my username has
14 characters two spaces between Nathan & Clarke.
So there is no bug at all.
Sorry for the hassle guys.
(i feel so stupid 8O )
Nathan |
|
| Back to top |
|
 |
Hortalonus Valued Contributor


Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Sep 25, 2002 6:33 pm Post subject: |
|
|
Believe me, you're not the first to make a mistake like that. I think we've all done something similar.  |
|
| Back to top |
|
 |
cnodnarb Professional Member


Joined: 11 Sep 2002 Posts: 766 Location: Eastman, GA
|
Posted: Wed Sep 25, 2002 6:55 pm Post subject: |
|
|
He's right, your not the first one to make that mistake, just look at America Online's title bar (with window spy or something)!!
NodNarb |
|
| Back to top |
|
 |
|