Page 1 of 2 12>
Topic Options
#127568 - 2004-10-07 05:25 PM this type of array not supported in expressions
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
ok.. I must be brain damaged, but I just cannot find this error

Quote:


C:\Documents and Settings\wheelerc>kix32 "C:\Documents and Settings\wheelerc\Des
ktop\Switches.kix"

ERROR : Error in expression: this type of array not supported in expressions.!
Script: C:\Documents and Settings\wheelerc\Desktop\Switches.kix
Line : 161

C:\Documents and Settings\wheelerc>





the code segment is:
Code:
 
$=WriteProfileString(@scriptdir+'\package.sed','Strings','FriendlyName','Silent '+$file)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','AppLaunched',$file+' '+$switch)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','FILE0',$file)
$=WriteProfileString(@scriptdir+'\package.sed','SourceFiles','SourceFiles0',$path)
Shell 'IExpress /n package.sed'
EndFunction
;******************************************************************
Function WriteFile($file,$array)



The error occurs on the shell statement, after it completes
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#127569 - 2004-10-07 05:28 PM Re: this type of array not supported in expressions
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
found it...

the command in the shell statement "Iexpress" is the same as the name of the function.

Rename the function, error goes away...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#127570 - 2004-10-07 05:47 PM Re: this type of array not supported in expressions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
then it's bug.
please report it.
function name in string causes error.
_________________________
!

download KiXnet

Top
#127571 - 2004-10-07 05:55 PM Re: this type of array not supported in expressions
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Eeeeyyyeeewww! That one could bite.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127572 - 2004-10-07 08:13 PM Re: this type of array not supported in expressions
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11629
Loc: CA
Hmmm.. as I recall I've run into this in the past as well, and as you just renamed it. Did not really cross my mind if it is/was a bug or not. Just thought it was some limitation in KiX.
Top
#127573 - 2004-10-07 09:13 PM Re: this type of array not supported in expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
does it still happen with NoStringsInVars turned on?
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#127574 - 2004-10-07 09:50 PM Re: this type of array not supported in expressions
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Quote:

NoStringsInVars



Is that the inverse of NoVarsInStrings?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127575 - 2004-10-07 09:54 PM Re: this type of array not supported in expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
I guess I have things a bit inside out today.


As Les astutely points out - I rarely know what I am talking.

SETOPTION ("NoVarsInStrings","ON")
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#127576 - 2004-10-07 10:00 PM Re: this type of array not supported in expressions
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Maybe your tongue was covering your eye teeth so you couldn't see what you were saying.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127577 - 2004-10-07 11:11 PM Re: this type of array not supported in expressio
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
I'm totally lost with this thread ... what the heck is the issue again ? can anybody post a little scriptlet demonstrating this (whatever it is).
Top
#127578 - 2004-10-08 04:24 AM Re: this type of array not supported in expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
The problem seems to be that the name of a function in the SHELL command string was being interpretted as its value and not as test.

I can not reproduce the described problem. I wrote this simple script that should reflect the problem as I read it. The script was tested with 4.02 and 4.22.

Code:
;setoption("NoVarsInStrings","ON")
function CMD()
? "in function 'CMD'"
Dim $A
$A = "1","a"
$CMD = $A
endfunction

shell 'CMD /c notepad.exe'

_________________________
Home page: http://www.kixhelp.com/hb/

Top
#127579 - 2004-10-08 01:38 PM Re: this type of array not supported in expressions
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
nope.
even though rad gave not the whole picture there, but if I read correctly, the code was like this:

Code:
function myownFunc()

shell "myownFunc"
endfunction

_________________________
!

download KiXnet

Top
#127580 - 2004-10-08 01:54 PM Re: this type of array not supported in expressions
Howard Bullock Offline
KiX Supporter
*****

Registered: 2000-09-15
Posts: 5809
Loc: Harrisburg, PA USA
Even if I move the SHELL statement inside the function, I can not reproduce the problem.
_________________________
Home page: http://www.kixhelp.com/hb/

Top
#127581 - 2004-10-08 02:25 PM Re: this type of array not supported in expressio
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
ja, thats kinda what I picked out of this thread, and I couldn't repro either:

break on

cmd()

exit 0

function cmd()

shell "cmd /c echo test"

endfunction


Top
#127582 - 2004-10-08 04:01 PM Re: this type of array not supported in expressio
Bryce Offline
KiX Supporter
*****

Registered: 2000-02-29
Posts: 3167
Loc: Houston TX
me too, even used a function named CMD :P could not reproduce.

even tried returning an array from the CMD function.

Code:

$ = cmd(1)
Shell 'cmd /c type test.kix'

Function cmd($things)
$cmd = Split($things)
EndFunction



Bryce

Top
#127583 - 2004-10-08 04:08 PM Re: this type of array not supported in expressio
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Where is Rad through all this? If his code manifested the problem, he should be able to repro.

Rad?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#127584 - 2004-10-08 09:56 PM Re: this type of array not supported in expressio
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Code:
 
Function Wrap()
Del @scriptdir+'\Package.sed'
Del '%userprofile%\desktop\silent_'+$file
$iexpress = '[Version]','Class=IEXPRESS','SEDVersion=3','[Options]','PackagePurpose=InstallApp',
'ShowInstallProgramWindow=1','HideExtractAnimation=1','UseLongFileName=1','InsideCompressed=0',
'CAB_FixedSize=0','CAB_ResvCodeSigning=0','RebootMode=N','InstallPrompt=%%InstallPrompt%%',
'DisplayLicense=%%DisplayLicense%%','FinishMessage=%%FinishMessage%%','TargetName=%%TargetName%%',
'FriendlyName=%%FriendlyName%%','AppLaunched=%%AppLaunched%%','PostInstallCmd=%%PostInstallCmd%%',
'AdminQuietInstCmd=%%AdminQuietInstCmd%%','UserQuietInstCmd=%%UserQuietInstCmd%%',
'SourceFiles=SourceFiles','[Strings]','InstallPrompt=','DisplayLicense=','FinishMessage=','TargetName=',
'FriendlyName=','AppLaunched=','PostInstallCmd=<None>','AdminQuietInstCmd=','UserQuietInstCmd=',
'FILE0=','[SourceFiles]','SourceFiles0=','[SourceFiles0]','%%FILE0%%='
$rc = writefile(@scriptdir+'\package.sed',$iexpress)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','TargetName','%userprofile%\desktop\silent_'+$file)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','FriendlyName','Silent '+$file)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','AppLaunched',$file+' '+$switch)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','FILE0','"'+$file+'"')
$=WriteProfileString(@scriptdir+'\package.sed','SourceFiles','SourceFiles0',$path)
Shell 'IExpress /n package.sed'
EndFunction



the funct was named iexpress, before I renamed it to wrap
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#127585 - 2004-10-08 09:58 PM Re: this type of array not supported in expressio
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Code:
 

Break On
$System = CreateObject("Kixtart.System")

;KD START

;************* Form **************
$SubForm1 = $System.Form()
$SubForm1.BackColor = 212,208,200
$SubForm1.Height = 391
$SubForm1.Left = 13
$SubForm1.MaximizeBox = "False"
$SubForm1.MinimizeBox = "False"
$SubForm1.ShowInTaskBar = "False"
$SubForm1.Text = "Select Command Line Switches"
$SubForm1.Top = 8
$SubForm1.Width = 342
;**************************************

$SubForm1.OpenFileDialog1 = $System.OpenFileDialog()
$SubForm1.OpenFileDialog1.InitialDirectory = '%userprofile%\desktop'
$SubForm1.OpenFileDialog1.Filter = "EXE files (*.exe)|*.exe|MSI Installers (*.msi)|*.msi"
$SubForm1.OpenFileDialog1.FilterIndex = 2
$SubForm1.OpenFileDialog1.RestoreDirectory = True

;************* FindApp **************
$FindApp = $SubForm1.Controls.Button("Find", 15, 15, 35, 20)
$FindApp.OnClick = "Find"
;**************************************

;************* TextBox2 **************
$SFXText2 = $SubForm1.Controls.TextBox("", 55, 15, 265, 20)
$SFXText2.Enabled = "False"
$SFXText2.FontBold = "True"
$SFXText2.TextAlign = 2
;**************************************

;************* GroupBox1 **************
$GroupBox1 = $SubForm1.Controls.GroupBox("Application Install Switches", 15, 45, 305, 274)
$GroupBox1.BackColor = 212,208,200
;**************************************

;************* RadioButton8 **************
$SFXOption8 = $GroupBox1.Controls.RadioButton("None", 30, 30, 64, 19)
$SFXOption8.BackColor = 212,208,200
$SFXOption8.Checked = "False"
;**************************************

;************* RadioButton1 **************
$SFXOption1 = $GroupBox1.Controls.RadioButton("/U /O /N /Z", 30, 60, 227, 19)
$SFXOption1.BackColor = 212,208,200
$SFXOption1.Checked = "False"
$SFXOption1.TabStop = "False"
;**************************************

;************* RadioButton2 **************
$SFXOption2 = $GroupBox1.Controls.RadioButton("/Q:A /R:N", 30, 90, 229, 19)
$SFXOption2.BackColor = 212,208,200
$SFXOption2.Checked = "False"
$SFXOption2.TabStop = "False"
;**************************************

;************* RadioButton3 **************
$SFXOption3 = $GroupBox1.Controls.RadioButton("-S", 30, 120, 230, 18)
$SFXOption3.BackColor = 212,208,200
$SFXOption3.Checked = "False"
$SFXOption3.TabStop = "False"
;**************************************

;************* RadioButton4 **************
$SFXOption4 = $GroupBox1.Controls.RadioButton("/SP- /VERYSILENT /NOREBOOT", 30, 150, 230, 17)
$SFXOption4.BackColor = 212,208,200
$SFXOption4.Checked = "False"
$SFXOption4.TabStop = "False"
;**************************************

;************* RadioButton5 **************
$SFXOption5 = $GroupBox1.Controls.RadioButton("/S", 30, 180, 230, 18)
$SFXOption5.BackColor = 212,208,200
$SFXOption5.Checked = "False"
$SFXOption5.TabStop = "False"
;**************************************

;************* RadioButton6 **************
$SFXOption6 = $GroupBox1.Controls.RadioButton("/qn Reboot=Suppress", 30, 210, 231, 18)
$SFXOption6.BackColor = 212,208,200
$SFXOption6.Checked = "False"
$SFXOption6.TabStop = "False"
;**************************************

;************* RadioButton7 **************
$SFXOption7 = $GroupBox1.Controls.RadioButton("Custom:", 30, 240, 64, 18)
$SFXOption7.BackColor = 212,208,200
$SFXOption7.Checked = "False"
$SFXOption7.TabStop = "False"
;**************************************

;************* TextBox1 **************
$SFXText1 = $GroupBox1.Controls.TextBox("", 100, 240, 183, 20)
;**************************************

;************* Button1 **************
$SFXOK = $SubForm1.Controls.Button("OK", 30, 330, 75, 23)
$SFXOK.Onclick = "Wrap()"
;**************************************

;************* Button2 **************
$SFXCancel = $SubForm1.Controls.Button("Cancel", 225, 330, 75, 23)
;**************************************

$Timer1 = $SubForm1.Timer()
$timer1.interval = 250
$timer1.ontick ="tick()"
$timer1.start()

;KD END

$SubForm1.Show
While $SubForm1.Visible
$= Execute($System.Application.DoEvents)
Loop

Exit 1

Function Tick()
$SFXText1.enabled = iif($SFXOption7.Checked,'true','false')
if $file
Select
Case $SFXOption8.checked $switch = ''
Case $SFXOption1.checked $switch = $SFXOption1.text
Case $SFXOption2.checked $switch = $SFXOption2.text
Case $SFXOption3.checked $switch = $SFXOption3.text
Case $SFXOption4.checked $switch = $SFXOption4.text
Case $SFXOption5.checked $switch = $SFXOption5.text
Case $SFXOption6.checked $switch = $SFXOption6.text
Case 1 $switch = $SFXtext1.text
EndSelect
$SFXText2.text = $File+' '+$switch
endif
EndFunction
;******************************************************************
Function Find()
If $SubForm1.OpenFileDialog1.ShowDialog() = $System.DialogResult.OK
$FileName = $SubForm1.OpenFileDialog1.Filename

$FilePos = instrrev($FileName ,"\")
$File = right($FileName,len($FileName)-$FilePos)
$Path = left($FileName,$FilePos)
$SFXText2.text = $File+' '+$switch
endif
Endfunction
;******************************************************************
Function Wrap()
Del @scriptdir+'\Package.sed'
Del '%userprofile%\desktop\silent_'+$file
$iexpress = '[Version]','Class=IEXPRESS','SEDVersion=3','[Options]','PackagePurpose=InstallApp',
'ShowInstallProgramWindow=1','HideExtractAnimation=1','UseLongFileName=1','InsideCompressed=0',
'CAB_FixedSize=0','CAB_ResvCodeSigning=0','RebootMode=N','InstallPrompt=%%InstallPrompt%%',
'DisplayLicense=%%DisplayLicense%%','FinishMessage=%%FinishMessage%%','TargetName=%%TargetName%%',
'FriendlyName=%%FriendlyName%%','AppLaunched=%%AppLaunched%%','PostInstallCmd=%%PostInstallCmd%%',
'AdminQuietInstCmd=%%AdminQuietInstCmd%%','UserQuietInstCmd=%%UserQuietInstCmd%%',
'SourceFiles=SourceFiles','[Strings]','InstallPrompt=','DisplayLicense=','FinishMessage=','TargetName=',
'FriendlyName=','AppLaunched=','PostInstallCmd=<None>','AdminQuietInstCmd=','UserQuietInstCmd=',
'FILE0=','[SourceFiles]','SourceFiles0=','[SourceFiles0]','%%FILE0%%='
$rc = writefile(@scriptdir+'\package.sed',$iexpress)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','TargetName','%userprofile%\desktop\silent_'+$file)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','FriendlyName','Silent '+$file)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','AppLaunched',$file+' '+$switch)
$=WriteProfileString(@scriptdir+'\package.sed','Strings','FILE0','"'+$file+'"')
$=WriteProfileString(@scriptdir+'\package.sed','SourceFiles','SourceFiles0',$path)
Shell 'IExpress.exe /n package.sed'
EndFunction
;******************************************************************
Function WriteFile($file,$array)
Dim $f, $_, $line
If Not VarType($Array) & 8192 Exit(1) EndIf
$f=FreeFileHandle
$_=Open($f,$file,5)
If @error Exit @error EndIf
For Each $line in $array
$_=WriteLine($f,$line+@crlf)
If @error Exit @error EndIf
Next
$_=Close($f)
EndFunction




there are 3 external file dependancies (iexpress.exe, makecab.exe, wextract.exe) and kixforms of course.
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#127586 - 2004-10-08 10:04 PM Re: this type of array not supported in expressio
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
now I see the problem...

I had a funct named Iexpress, then I populated that named function as a var ($iexpress, like you do for return values), and then I executed an external file named the same as the funct, and it looked to be trying to recurse to itself.

Basically it was a giant mess. I guess that is to be expected when trying to get back into an old project...
_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#127587 - 2004-10-08 10:10 PM Re: this type of array not supported in expressio
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
well, can you reproduce it?
_________________________
!

download KiXnet

Top
Page 1 of 2 12>


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

Who's Online
1 registered (Allen) and 905 anonymous users online.
Newest Members
batdk82, StuTheCoder, M_Moore, BeeEm, min_seow
17885 Registered Users

Generated in 0.079 seconds in which 0.03 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