git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2668 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
joostverburg 2003-06-23 12:51:31 +00:00
parent c6fcdeb6ba
commit 7fdfd8a0c5

View file

@ -479,50 +479,53 @@ value of a Field using ReadINIStr:</p>
<pre class="margin"> <pre class="margin">
ReadINIStr $R0 "$PLUGINSDIR\test.ini" "Field 1" "State" ReadINIStr $R0 "$PLUGINSDIR\test.ini" "Field 1" "State"
</pre> </pre>
<p class="text">&nbsp;&nbsp;&nbsp;&nbsp; Important Note:</p> <p class="text"><span class="bold">Note:</span></p>
<p class="text">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; For Multiline edit <p class="text">For Multiline edit boxes the output &quot;State&quot; comes with &quot;\r\n&quot;
boxe's the output &quot;State&quot; comes with &quot;\r\n&quot; if text as more if the text contains more than one line. You have to convert it to &quot;$\r$\n&quot; if needed,
than one line and is your responsiblity to convert it inside script to using this macro:</p>
&quot;$\r$\n&quot; if needed! example macro:</p> <pre class="margin">!macro NORMALIZE_CRCF VALUE
<pre class="margin">NORMALIZE_CRCF VALUE
push $1 ; Index ;Note: Do not use $R1-$R4 as value
push $2 ; Output char by char
push $3 ; Output char by char next Push $R1 ; Index
push $4 ; Text Accumulator Push $R2 ; Output char by char
Push $R3 ; Output char by char next
Push $R4 ; Text Accumulator
StrCpy $R1 &quot;0&quot;
StrCpy $1 &quot;0&quot;
DONEXT: DONEXT:
StrCpy $2 ${VALUE} 1 $1 StrCpy $R2 ${VALUE} 1 $R1
IntOp $1 $1 + 1 IntOp $R1 $R1 + 1
StrCpy $3 ${VALUE} 1 $1 StrCpy $R3 ${VALUE} 1 $R1
StrCmp $3 &quot;&quot; EOT StrCmp $R3 &quot;&quot; EOT
StrCmp $2 &quot;\&quot; 0 NORMAL_CHAR StrCmp $R2 &quot;\&quot; 0 NORMAL_CHAR
StrCmp $3 &quot;r&quot; FOUND_CR StrCmp $R3 &quot;r&quot; FOUND_CR
StrCmp $3 &quot;n&quot; 0 NORMAL_CHAR StrCmp $R3 &quot;n&quot; 0 NORMAL_CHAR
;FOUND_LF:
StrCpy $4 &quot;$4$\r&quot; StrCpy $R4 &quot;$R4$\r&quot;
IntOp $1 $1 + 1 IntOp $R1 $R1 + 1
goto DONEXT Goto DONEXT
FOUND_CR: FOUND_CR:
StrCpy $4 &quot;$4$\n&quot; StrCpy $R4 &quot;$R4$\n&quot;
IntOp $1 $1 + 1 IntOp $R1 $R1 + 1
goto DONEXT Goto DONEXT
NORMAL_CHAR: NORMAL_CHAR:
StrCpy $4 &quot;$4$2&quot; StrCpy $R4 &quot;$R4$R2&quot;
goto DONEXT Goto DONEXT
EOT: EOT:
StrCpy ${VALUE} $4 StrCpy ${VALUE} $R4
pop $4
pop $3 Pop $R4
pop $2 Pop $R3
pop $1 Pop $R2
Pop $R1
!macroend !macroend
</pre> </pre>
<pre class="margin">&nbsp;</pre>
<p class="subheader">Validate the input</p> <p class="subheader">Validate the input</p>
<p class="text">If you want to validate the input on the page, <p class="text">If you want to validate the input on the page,
for example, you want to check whether the user has filled in for example, you want to check whether the user has filled in