| |
|
|
- Page 1 - |
|
Michael W. | Have one shelf before the head. i want still only one Hash-aray a function out benefit. Weder The direct indicated yet The Parameter Passing functions.
who zerdrückt me whom small Krabbler... (erl. )
' Vorgaben :
' Set("HashDel", "|")
' Set("HashListDel", Chr$(254))
' Set("HashMode", 0) // 0= case sensitive, 1= ignore case
MkDir "C:\\temp"
If %IOResult : Beep : EndIf
Set("LogFile", "C:\\temp\\XProfanErrorLog.txt")
LogOut "---start"
Declare hash TransVars[]
TransVars["align"] = "\qcenter\q"
TransVars["valign"] = "\qmiddle\q"
TransVars["bgcolor"] = "\q#FFFF00\q"
TransVars["class"] = "\qSmaller\q"
TransVars["font_color"] = "\q#FF0000\q"
TransVars["text_1"] = "Eintrag"
LogOut "hash erzeugt"
Proc HashTrans
Parameters hash t_v[], string Text
Declare string key,value
LogOut "in hashtrans"
' ForEach TransVars[], key, value
ForEach t_v[], key, value
LogOut "key= "+ key + ", value= " + value
Text = Translate$( Text, "{°"+key+"°}", value )
EndFor
LogOut "hashtrans ende"
Return Text
ENDPROC
Cls
LogOut "hinter Cls"
Print HashTrans("<td align={°align°} valign={°valign°} bgcolor={°bgcolor°} class={°class°}><font color={°font_color°}>{°text_1°}</font></td>")
LogOut "hinter the Funktionsaufruf"
Clear TransVars[]
LogOut "hinter Clear"
WaitKey
Set("LogFile", "")
End
|
|
|
| System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 03/20/16 ▲ |
|
|
|
|
« this Posting watts as Solution marked. » |
|
RGH | means with Parameter functions it, if you then too TransVars[] as first Parameter when calling the function angibst:
the others trouble is objectively one solches. If it too solid was, The Schleifenvariablen with FOR / FOREACH as local variables To style (How about in Delphi), so schieße I here möglicherweise a little bit over the target out, if it too the Hash-aray concerns. on the other hand becomes one into most Make, if is a function/procedure writes, The one Hash-aray machine your this too as Parameter transfer.
it would objectively To consider, whether I The constraint on local variables here in the next Version weglasse.
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/20/16 ▲ |
|
|
|
|
|
Michael W. | The direct indicated in the Hauptprogramm functions...
means runs there something schief.
If already not as Parameter "hash t_v[]", then should at least the direct appeal "TransVars[]" in the function functions. goes but not.
' Vorgaben :
' Set("HashDel", "|")
' Set("HashListDel", Chr$(254))
' Set("HashMode", 0) // 0= case sensitive, 1= ignore case
MkDir "C:\\temp"
If %IOResult
Beep
EndIf
Set("LogFile", "C:\\temp\\XProfanErrorLog.txt")
LogOut "---start"
Declare hash TransVars[]
TransVars["align"] = "\qcenter\q"
TransVars["valign"] = "\qmiddle\q"
TransVars["bgcolor"] = "\q#FFFF00\q"
TransVars["class"] = "\qSmaller\q"
TransVars["font_color"] = "\q#FF0000\q"
TransVars["text_1"] = "Eintrag"
LogOut "hash erzeugt"
Cls
LogOut "hinter Cls"
'Print HashTrans("<td align={°align°} valign={°valign°} bgcolor={°bgcolor°} class={°class°}><font color={°font_color°}>{°text_1°}</font></td>")
'LogOut "hinter the Funktionsaufruf"
var string Text = "<td align={°align°} valign={°valign°} bgcolor={°bgcolor°} class={°class°}><font color={°font_color°}>{°text_1°}</font></td>"
'Proc HashTrans
' Parameters hash t_v[], string Text
Declare string key,value
LogOut "in hashtrans"
ForEach TransVars[], key, value
' ForEach t_v[], key, value
LogOut "key= "+ key + ", value= " + value
Text = Translate$( Text, "{°"+key+"°}", value )
EndFor
LogOut "hashtrans ende"
' Return Text
'ENDPROC
print Text
LogOut Text
Clear TransVars[]
LogOut "hinter Clear"
WaitKey
Set("LogFile", "")
End
|
|
|
| XProfan X3System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 03/20/16 ▲ |
|
|
|
|
RGH | means with Parameter functions it, if you then too TransVars[] as first Parameter when calling the function angibst:
the others trouble is objectively one solches. If it too solid was, The Schleifenvariablen with FOR / FOREACH as local variables To style (How about in Delphi), so schieße I here möglicherweise a little bit over the target out, if it too the Hash-aray concerns. on the other hand becomes one into most Make, if is a function/procedure writes, The one Hash-aray machine your this too as Parameter transfer.
it would objectively To consider, whether I The constraint on local variables here in the next Version weglasse.
Greeting Roland |
|
|
| Intel Duo E8400 3,0 GHz / 4 GB RAM / 1000 GB HDD - ATI Radeon HD 4770 512 MB - Windows 7 Home Premium 32Bit - XProfan X4 | 03/20/16 ▲ |
|
|
|
|
Michael W. | I thanks you.
by the many hither and thither have I there objectively what overlooking.
really is the thing with the local variables ok, it asks itself only How the then with very large Hasharrays looks.
here again The funktionsfähige Version.
|
|
|
| XProfan X3System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 03/21/16 ▲ |
|
|
|