home
products
contribute
download
documentation
forum
Home
Forums
New posts
Search forums
What's new
New posts
All posts
Latest activity
Members
Registered members
Current visitors
Donate
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Search titles only
By:
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Language specific support
Deutsches MediaPortal Forum
MediaPortal 1
TV / Streaming
Elektronischer Programmführer (EPG)
EPG-Buddy ein neues EPG Tool
Contact us
RSS
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="zunixnuz" data-source="post: 1220770" data-attributes="member: 62883"><p>Ich verstehe schon was globale und lokale Variablen sind,</p><p>aber in jeder anderen Programmiersprache (ich behersche da ein paar) würde ich eine globale Deklaration nicht innerhalb des "if" scopes machen</p><p>da dann sowiso jeder Compiler berechtigterweise mekern würde da ja die Deklaration nur bedingt (je nach if Ergebnis) erfolgen würde.</p><p>Folgender Code funktioniert:</p><p>[code]; Read checked groups</p><p>Global $fle_hwnd</p><p>If Not FileExists(@ScriptDir & "\groups.ini") Then</p><p> $fle_hwnd = FileOpen(@ScriptDir & "\groups.ini", 8)</p><p> FileClose($fle_hwnd)</p><p>EndIf</p><p></p><p>Dim $Groups_checked[1]</p><p>_FileReadToArray(@ScriptDir & "\groups.ini", $Groups_checked)</p><p></p><p>If Not FileExists(@ScriptDir & "\groups3.ini") Then</p><p> $fle_hwnd = FileOpen(@ScriptDir & "\groups3.ini", 8)</p><p> FileClose($fle_hwnd)</p><p>EndIf</p><p></p><p>Dim $Groups_checked3[1]</p><p>_FileReadToArray(@ScriptDir & "\groups3.ini", $Groups_checked3)</p><p>[/code]</p></blockquote><p></p>
[QUOTE="zunixnuz, post: 1220770, member: 62883"] Ich verstehe schon was globale und lokale Variablen sind, aber in jeder anderen Programmiersprache (ich behersche da ein paar) würde ich eine globale Deklaration nicht innerhalb des "if" scopes machen da dann sowiso jeder Compiler berechtigterweise mekern würde da ja die Deklaration nur bedingt (je nach if Ergebnis) erfolgen würde. Folgender Code funktioniert: [code]; Read checked groups Global $fle_hwnd If Not FileExists(@ScriptDir & "\groups.ini") Then $fle_hwnd = FileOpen(@ScriptDir & "\groups.ini", 8) FileClose($fle_hwnd) EndIf Dim $Groups_checked[1] _FileReadToArray(@ScriptDir & "\groups.ini", $Groups_checked) If Not FileExists(@ScriptDir & "\groups3.ini") Then $fle_hwnd = FileOpen(@ScriptDir & "\groups3.ini", 8) FileClose($fle_hwnd) EndIf Dim $Groups_checked3[1] _FileReadToArray(@ScriptDir & "\groups3.ini", $Groups_checked3) [/code] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Language specific support
Deutsches MediaPortal Forum
MediaPortal 1
TV / Streaming
Elektronischer Programmführer (EPG)
EPG-Buddy ein neues EPG Tool
Contact us
RSS
Top
Bottom