Beispiel:
Code: Alles auswählen
[Actions]
DefFunc Test(Val $Test$:StringList):Void
Comment TakeString(0,$Test$)
EndFunc
SetLogLevel=9
Test(CreateStringList("test"))
Code: Alles auswählen
[1] [Jun 19 11:07:20:302] --
[1] [Jun 19 11:07:20:303] --
[1] [Jun 19 11:07:20:304] c:\opsi.org\log\opsi-script-part-Mr57Wl49.log
[1] [Jun 19 11:07:20:306] opsi-script 4.12.0.20 started at 19.06.2018 11:07:18
[1] [Jun 19 11:07:20:307] opsi-script log file with encoding utf8
[3] [Jun 19 11:07:20:309] readconfig failed: Perhaps got defaults
[6] [Jun 19 11:07:20:311] Depot path from readconfig: p:\
[6] [Jun 19 11:07:20:312] Restoring depot path from backup
[1] [Jun 19 11:07:20:313] Prog: force_min_loglevel: 4
[1] [Jun 19 11:07:20:314] Prog: default_loglevel: 7
[1] [Jun 19 11:07:20:315] Prog: debug_prog: False
[1] [Jun 19 11:07:20:317] Prog: debug_lib: False
[1] [Jun 19 11:07:20:319] Prog: ScriptErrorMessages: False
[1] [Jun 19 11:07:20:320] Prog: AutoActivityDisplay: False
[6] [Jun 19 11:07:20:320] Using new Depot path:
[1] [Jun 19 11:07:20:324]
[1] [Jun 19 11:07:20:326] ============ Version 4.12.0.20 script "C:\Users\user\test.opsiscript"
[1] [Jun 19 11:07:20:328] used script encoding: cp1252
[1] [Jun 19 11:07:20:330] used system encoding: cp1252
[1] [Jun 19 11:07:20:332] start: 2018-06-19 11:07:20
[1] [Jun 19 11:07:20:334] on client named "client"
[1] [Jun 19 11:07:20:338] loggedin user "user"
[1] [Jun 19 11:07:20:340] opsi-script running as "user"
[4] [Jun 19 11:07:20:342] opsi-script not running with admin privileges
[1] [Jun 19 11:07:20:344] opsi-script running in standard script mode
[1] [Jun 19 11:07:20:345] executing: "C:\Program Files (x86)\opsi.org\opsi-client-agent\opsi-winst\winst32.exe"
[1] [Jun 19 11:07:20:347] system infos:
[1] [Jun 19 11:07:20:364] 94-65-9C-3D-AF-21 - PC hardware address
[1] [Jun 19 11:07:20:367] client.fqdn.de - IP name
[1] [Jun 19 11:07:20:369] 192.168.56.1 - IP address
[1] [Jun 19 11:07:20:371] DEU - System default locale
[7] [Jun 19 11:07:20:373] Registry started without redirection (64 Bit)
[1] [Jun 19 11:07:20:375] MS Windows 10.0 64 Bit, Edition: Windows Enterprise 2015 LTSB
[1] [Jun 19 11:07:20:377]
[7] [Jun 19 11:07:20:381] Registry started readonly
[7] [Jun 19 11:07:20:383] Registry started without redirection (64 Bit)
[6] [Jun 19 11:07:20:388] Registry key [HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion] opened
[6] [Jun 19 11:07:20:391] Key closed
[6] [Jun 19 11:07:20:437] Added defined function: test to the known functions
[6] [Jun 19 11:07:20:439] LogLevel was 7
[6] [Jun 19 11:07:20:440] LogLevel set to 9
[9] [Jun 19 11:07:20:442] Parsingprogress: r: Test(CreateStringList("test")) exp:
[9] [Jun 19 11:07:20:444] Parsingprogress: r: (CreateStringList("test")) exp: Test
[8] [Jun 19 11:07:20:446] We are coming from function with index: -1 (-1 = base)
[8] [Jun 19 11:07:20:448] We enter the defined function: test with 1 lines. inDefFuncLevel: 1
[8] [Jun 19 11:07:20:449] Paramnr: 0 is : CreateStringList("test"
[2] [Jun 19 11:07:20:453] Syntax Error: Parameter parsing failed: Expressionstr not terminated Error: StringList expression expected, but: CreateStringList("test" gives no stringlist
[8] [Jun 19 11:07:20:455] We leave the defined function: test ; inDefFuncLevel: 0
[3] [Jun 19 11:07:20:457] Call of defined function: Test failed
[1] [Jun 19 11:07:20:462] ___________________
[1] [Jun 19 11:07:20:464] script finished: success
[1] [Jun 19 11:07:20:466] 0 errors
[1] [Jun 19 11:07:20:470] 0 warnings
[1] [Jun 19 11:07:20:471]
[1] [Jun 19 11:07:20:473]
[8] [Jun 19 11:07:20:475] End of CreateAndProcessScript
Ich bin mir fast sicher dass dies schonmal funktioniert hat.
Wenn ich die StringListe vor der Übergabe in eine entsprechende Variable stecke, funktioniert es.