Page 1 of 1 1
Topic Options
#124105 - 2004-07-29 01:55 PM Drive mapping ini file
aenm Offline
Fresh Scripter

Registered: 2004-07-29
Posts: 7
Hi there,

I'm getting the hang of kixtart but maybe someone can help me out with this problem.

I use KiXGUI 1.0 also to get that nice interface.

Trough a function (a part is shown below) I read strings from a ini file:
Code:

Dim $tmpDrv
$Sec = ReadProfileString($inFile,$inSec,"")
$aMaps = Split($Sec,Chr(10),-1)
$ileft = 3
$itop = 6
For Each $a In $aMaps
$tmpDrv = ReadProfileString($inFile,$inSec,$a)
$aParms = Split($tmpDrv,",")
$act = Ubound($aParms)
If $act = 1
If Exist ($aParms[1])
Use $aParms[0] + ":" $aParms[1]
$path = $aParms[0] + ":" + $aParms[1]
$form.text = $form.text + $path + Chr(13) + Chr(10)
Else
$form.text = $form.text + "Error bij het aanmaken" + $aParms[1] + Chr(13) + Chr(10)
EndIf
EndIf
Next
$GroupMap = 1
EndFunction



Many of you will know this code. I ripped it from the internet.
With the use of the ini file it works fine, but when a macro is defined the string would not recognize the part of the string (\\servername\$USERID). Can someone help me out how to read or convert this so the username is given right?

Sorry for the worse english.

Martin

Top
#124106 - 2004-07-29 02:02 PM Re: Drive mapping ini file
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11161
Loc: Boston, MA, USA
I don't see where in your string you define a macro. See the MapDrive() UDF as it demonstrates how to resolve macros inside a text string.
_________________________
There are two types of vessels, submarines and targets.

Top
#124107 - 2004-07-29 02:40 PM Re: Drive mapping ini file
aenm Offline
Fresh Scripter

Registered: 2004-07-29
Posts: 7
Sorry I misspelled my line.
I use \\servername\@USERID in my ini file as followed:

MapDrive1=u,\\ servername \@USERID

The @USERID isn't translated.

Top
#124108 - 2004-07-29 03:34 PM Re: Drive mapping ini file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
yep.
replace:
Use $aParms[0] + ":" $aParms[1]

with:
$nul=execute(Use $aParms[0] + ":" $aParms[1])

and see if that does the trick.
_________________________
!

download KiXnet

Top
#124109 - 2004-07-29 05:24 PM Re: Drive mapping ini file
aenm Offline
Fresh Scripter

Registered: 2004-07-29
Posts: 7
I will try. But not now
Top
#124110 - 2004-07-30 12:23 AM Re: Drive mapping ini file
Jochen Moderator Online   happy
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6230
Loc: Stuttgart, Germany
Quote:


I use KiXGUI 1.0 also to get that nice interface.





see my sig to get an even nicer interface
_________________________
I cna ytpe 300 wrods pre mniuet!!

Kixforms forum.

Top
#124111 - 2004-07-30 02:12 PM Re: Drive mapping ini file
aenm Offline
Fresh Scripter

Registered: 2004-07-29
Posts: 7
Quote:

yep.
replace:
Use $aParms[0] + ":" $aParms[1]

with:
$nul=execute(Use $aParms[0] + ":" $aParms[1])

and see if that does the trick.




After that I get (while running the script) "Error in expression".

Top
#124112 - 2004-07-30 02:15 PM Re: Drive mapping ini file
aenm Offline
Fresh Scripter

Registered: 2004-07-29
Posts: 7
Quote:

Quote:


I use KiXGUI 1.0 also to get that nice interface.





see my sig to get an even nicer interface




Yep, you convinced me. I use the kixforms.dll in combination with the wkix32.exe and that ugly prompt box is gone

Top
#124113 - 2004-08-02 10:27 AM Re: Drive mapping ini file
aenm Offline
Fresh Scripter

Registered: 2004-07-29
Posts: 7
If InStr($aParms[1],'@@')
$rc=Execute('$aParms[1]="'+$aParms[1]+'"')
EndIf

This did the trick.

Many thanks

Top
#124114 - 2004-08-02 01:28 PM Re: Drive mapping ini file
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22298
Loc: OK
the execute rules sometimes get us, specially if novarsinstrings is set to on.
glad to hear you worked it out yourself.
_________________________
!

download KiXnet

Top
Page 1 of 1 1


Moderator:  Glenn Barnas, NTDOC, Arend_, Jochen, Radimus, Allen, ShaneEP, Mart 
Hop to:
Shout Box

Who's Online
1 registered (Allen) and 151 anonymous users online.
Newest Members
MikeKrausnick, Ruggiero, xempa333, KroodjeBip, Thala
17470 Registered Users

Generated in 0.032 seconds in which 0.01 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org