View previous topic :: View next topic |
Author |
Message |
Hortalonus Valued Contributor
Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Mar 27, 2002 7:11 pm Post subject: Help with INIFILE WRITE... |
|
|
I need a bit of help here... I've created an app to save volume settings for users which can be recalled later by using a unique PIN number. I want to save each user's settings in a file on a NetWare server. When I run the code it will create the file but none of the settings are written to the file. The resulting file is 0 bytes. If I change the target directory to the local HD it writes it just fine. I have READ, WRITE, CREATE, ERASE, MODIFY, and FILE SCAN rights to the server directory. Mapping it to a drive doesn't help either. Any ideas?
Here is the code to save the settings...
Code: |
EXTERNAL VDSMIX.DLL
%%pinsDIR = \\SERVER\VOLUME\USER\HORTALONUS
DIALOG CREATE,Save Volume Settings,-1,0,242,121
DIALOG ADD,EDIT,pinINPUT,20,50,38,19
DIALOG ADD,EDIT,nameINPUT,54,50,180,19
DIALOG ADD,BUTTON,save,88,80,82,24,Save Settings
DIALOG ADD,TEXT,label1,24,10,,,PIN:
DIALOG ADD,TEXT,label2,58,10,,,Name:
DIALOG SHOW
:EVLOOP
WAIT EVENT
GOTO @EVENT()
:saveBUTTON
%%PIN = @DLGTEXT(pinINPUT)
%%name = @DLGTEXT(nameINPUT)
LIST CREATE,1
LIST CREATE,2
LIST CREATE,3
LIST ADD,2,@MIXER(GETCONTROLTYPES)
LIST ASSIGN,1,2
LIST CLEAR,2
IF @GREATER(@COUNT(1),0)
LIST SEEK,1,0
%%control = @ITEM(1)
LIST ADD,3,@MIXER(GETAUDIOTYPES,@ITEM(1))
LIST ASSIGN,2,3
LIST CLOSE,3
END
INIFILE OPEN,%%pinsDIR"\"%%PIN".vcp"
INIFILE WRITE,AGENT,NAME,%%name
%i = -1
%j = -1
IF @GREATER(@COUNT(2),0)
REPEAT
%i = @SUCC(%i)
LIST SEEK,2,%i
%%vol = @FORMAT(@FDIV(@MIXER(GETVOLUME,%%control,@ITEM(2),RIGHT),655),3.0)
IF @EQUAL(@MIXER(GETVOLUME,%%control,@ITEM(2),MUTE),1)
%%mute = 1
ELSE
%%mute = 0
END
IF @GREATER(%%vol,0)
%j = @SUCC(%j)
%%source = @SUBSTR(@ITEM(2),1,3)
INIFILE WRITE,"SOURCE"%j,name,%%source
INIFILE WRITE,"SOURCE"%j,volPERCENT,%%vol
INIFILE WRITE,"SOURCE"%j,mute,%%mute
END
UNTIL @EQUAL(@INDEX(2),@PRED(@COUNT(2)))
INFO Settings have been saved for %%name under PIN %%PIN.
END
LIST CLOSE,1
LIST CLOSE,2
:CLOSE
EXIT
|
|
|
Back to top |
|
|
Mac Professional Member
Joined: 08 Jul 2000 Posts: 1585 Location: Oklahoma USA
|
Posted: Wed Mar 27, 2002 9:34 pm Post subject: |
|
|
Have you tried saving a text file to the server? If you can,
you could store the info in it (userx.dat or whatever) and
load the file to a list to get the values. If this works, then
I'm guessing the problem is specific to INI files.
Cheers, Mac _________________ 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 |
|
|
Sylvester Valued Newbie
Joined: 31 Jul 2000 Posts: 43 Location: Boston, MA USA
|
Posted: Wed Mar 27, 2002 9:59 pm Post subject: |
|
|
Hi, Mac. I am not sure it's with ini files. I took a look at this too. It works with NT servers, using UNC path and mapping the drive. Here is the result I got in the file it created 123.vcp.
Quote: | [AGENT]
NAME=testmix
[SOURCE0]
name=Mas
volPERCENT=4
mute=0
[SOURCE1]
name=Wav
volPERCENT=62
mute=0
[SOURCE2]
name=SW
volPERCENT=69
mute=0
[SOURCE3]
name=CD
volPERCENT=59
mute=0
[SOURCE4]
name=Mic
volPERCENT=50
mute=1
[SOURCE5]
name=Lin
volPERCENT=50
mute=0
[SOURCE6]
name=Aux
volPERCENT=50
mute=0
[SOURCE7]
name=Vid
volPERCENT=50
mute=0
[SOURCE8]
name=Cry
volPERCENT=94
mute=0
[SOURCE9]
name=Pho
volPERCENT=50
mute=0
[SOURCE10]
name=PC
volPERCENT=50
mute=0 |
I currently do not have any NetWare servers so I can't test it using that. I am leaning towards possible issues with trying to access NetWare servers. But without having NetWare servers to test, I can't be certain. _________________ Sylvester
In the immortal words of the great philosopher, Homer ... "D'OH!!!" 8O |
|
Back to top |
|
|
Hortalonus Valued Contributor
Joined: 15 Mar 2002 Posts: 344 Location: Western USA
|
Posted: Wed Mar 27, 2002 11:16 pm Post subject: |
|
|
I changed the code to use a list and save it as a text file in INI format. It worked fine.
Code: |
LIST CREATE,7
LIST ADD,7,[AGENT]
LIST ADD,7,name=%%name
LIST ADD,7,
REM INIFILE OPEN,%%pinsDIR"\"%%PIN".vcp"
REM INIFILE WRITE,AGENT,NAME,%%name
%k = -1
%l = -1
IF @greater(@count(2),0)
REPEAT
%k = @SUCC(%k)
LIST SEEK,2,%k
%%vol = @FORMAT(@FDIV(@mixer(getvolume,%%control,@item(2),RIGHT),655),3.0)
IF @EQUAL(@mixer(getvolume,%%control,@item(2),MUTE),1)
%%mute = 1
ELSE
%%mute = 0
END
IF @GREATER(%%vol,0)
%l = @SUCC(%l)
%%source = @SUBSTR(@ITEM(2),1,3)
LIST ADD,7,[SOURCE%l]
LIST ADD,7,name=%%source
LIST ADD,7,volPERCENT=%%vol
LIST ADD,7,mute=%%mute
LIST ADD,7,
REM INIFILE WRITE,"SOURCE"%l,name,%%source
REM INIFILE WRITE,"SOURCE"%l,volPERCENT,%%vol
REM INIFILE WRITE,"SOURCE"%l,mute,%%mute
END
UNTIL @EQUAL(@INDEX(2),@PRED(@COUNT(2)))
LIST SAVEFILE,7,%%pinsDIR"\"%%PIN".vcp"
LIST CLOSE,7
INFO Settings have been saved for %%name under PIN %%PIN.
END
|
I don't know if it's a NetWare thing or something to do with INIs. I would prefer to change the file directly rather than overwrite the file each time a setting is changed, but then we don't always get what we want, do we? Thanks for your help guys! |
|
Back to top |
|
|
|
|
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
|
|