Page 2 of 2 <12
Topic Options
#205336 - 2012-05-25 08:37 PM Re: variable in variable [Re: Les]
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
It's something with the quotes.

Change this line:
 Code:
$junk = execute ('$$LDRIVE="'+$LDR+'"')
With this line:
 Code:
$junk = execute ('$$LDRIVE='+$LDR)


It then sets it to blank if not defined instead of to the variable name.
 Code:
$lokalDrive_G = "\\Server\Share"

For $Count = 65 To 90 Step 1 
   $L  = Chr ($Count)
   $LD = $L + ":"
   $LDR = "$$lokalDrive_" + $L
   $junk = execute ('$$LDRIVE='+$LDR)

   If $LDRIVE
      $Counter = 0
      DO
         $Counter = $Counter + 1
         If Exist ($LD) = 1
            Use $LD /Del
            Use $LD $LDRIVE
         Else
            Use $LD $LDRIVE
         EndIf
      Until Exist($LD) = 1 or $Counter = 5
      If Exist ($LD) = 0
         MessageBox ("ACHTUNG! Kein " + $L + "-Laufwerk vorhanden! Evtl. sind Sie nicht richtig am Netzwerk angemeldet.", "@TIME", 0)
         $Error = $L + " "
      EndIf
   EndIf
Next

Top
#205337 - 2012-05-25 09:01 PM Re: variable in variable [Re: ShaneEP]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
hmm... it sets it to blank and doesn't error?
well, I guess it will but kixtart doesn't give execute() errors so it will work.
good catch.
_________________________
!

download KiXnet

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 616 anonymous users online.
Newest Members
M_Moore, BeeEm, min_seow, Audio, Hoschi
17883 Registered Users

Generated in 0.173 seconds in which 0.153 seconds were spent on a total of 13 queries. Zlib compression enabled.

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