splitstring illegal String expression

Antworten
Lo5t
Beiträge: 6
Registriert: 08 Nov 2011, 10:57

splitstring illegal String expression

Beitrag von Lo5t »

I have an install script which successfully installs the printer drivers i want for specific printer. The printer i select over a product properties tab. I now want to select more then one printer. I don't want to wait untill each driver is installed before having to install the packet again with different product property setting.
So I have selected a property as two printers seperated with a comma. Yet this fails on both splitString (with illegal String expression) and on the following line ( for %s% in $printers$ do sub_startinstall - with no valid expression for a string list).

Code: Alles auswählen

[Actions]
DefVar $printer$
Defvar $toInstall$
Defvar $printers$

Set $printer$ =  GetProductProperty("printer", "")

comment "Start setup program"

set $printers$ = splitString($printer$,",")
for %s% in $printers$ do sub_startinstall

[sub_startinstall]
comment "Installing printer"
set $toInstall$ = "%s%"
DosBatch_install

[DosBatch_install]
%scriptpath%\winprinter.exe --cfg %scriptpath% --add $toInstall$
ProductProperty Printer is:

Code: Alles auswählen

values: ["OFF_PRINTER_1,OFF_PRINTER_2", "Room2_OFF_PRINTER", "Room3_OFF_PRINTER"]
Any Help would be much appriciated
Benutzeravatar
tobias
Beiträge: 1294
Registriert: 20 Aug 2008, 12:36
Wohnort: Braunschweig
Kontaktdaten:

Re: splitstring illegal String expression

Beitrag von tobias »

please try without the "

like this:
values: [OFF_PRINTER_1, OFF_PRINTER_2, Room2_OFF_PRINTER, Room3_OFF_PRINTER]
Lo5t
Beiträge: 6
Registriert: 08 Nov 2011, 10:57

Re: splitstring illegal String expression

Beitrag von Lo5t »

but this would give me all printers as an option.
I would like to have the following as ProductProperties:

OFF_PRINTER_1,OFF_PRINTER_2
Room2_OFF_PRINTER
Room3_OFF_PRINTER

If i do what u say i would recieve something like this:

OFF_PRINTER_1
OFF_PRINTER_2
Room2_OFF_PRINTER
Room3_OFF_PRINTER

I would like my script to automatically install an amount of printers i have selected. in est if the product property lists, for example, 3 printers, the script should loop the install routine 3 time.
Benutzeravatar
d.oertel
uib-Team
Beiträge: 3327
Registriert: 04 Jun 2008, 14:27

Re: splitstring illegal String expression

Beitrag von d.oertel »

Hi,

Code: Alles auswählen

Defvar $printers$
set $printers$ = splitString($printer$,",")
wrong variable declaration: $printers$ has to be a stringlist:

Code: Alles auswählen

DefStringlist $printers$
regards

d.oertel


Vielen Dank für die Nutzung von opsi. Im Forum ist unser Support begrenzt.

Für den professionellen Einsatz und individuelle Beratung empfehlen wir einen Support-Vertrag und eine Schulung.
Gerne informieren wir Sie zu unserem Angebot.

uib GmbH
Telefon: +49 6131 27561 0
E-Mail: sales@uib.de


Antworten