Page 1 of 1 1
Topic Options
#113913 - 2004-02-12 06:04 PM Execute Statement Problem
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Trying to get the below code to work. It just creates a string of hex values from the users full name so that it can be put into Office and the user not get prompted. There is something wrong with me Execute statements as I always get a 'missing comma' error for the line right after the first execute. Any suggestions?

Code:
$UserName = @FullName
If Len ($UserName) > 0
For $x=1 to 30
$null=Execute('$userchar'+$x+'=LCase(DecToHex(ASC(SubStr('+$UserName+','+$x+',1)))))'
$null=Execute("$$username=$username+$userchar$x+'00'"
Next
Endif


Top
#113914 - 2004-02-12 06:13 PM Re: Execute Statement Problem
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
The second EXECUTE has a missing closing parenthesis.

However, why do you go this complicated EXECUTE way?
Code:

$UnicodeUsername=''
for $pos=1 to len($username)
$UnicodeUsername=$UnicodeUsername+dectohex(asc(substr($username,$pos,1)))+'00'
next
? $username
? $unicodeusername

_________________________
There are two types of vessels, submarines and targets.

Top
#113915 - 2004-02-12 06:56 PM Re: Execute Statement Problem
ShaneEP Moderator Offline
MM club member
*****

Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
Good question...

Thanks for the better code.

Top
Page 1 of 1 1


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

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.057 seconds in which 0.029 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