From 7fdfd8a0c5d94d1ad5c7fa5686c0b304862d0730 Mon Sep 17 00:00:00 2001 From: joostverburg Date: Mon, 23 Jun 2003 12:51:31 +0000 Subject: [PATCH] format git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2668 212acab6-be3b-0410-9dea-997c60f758d6 --- Contrib/InstallOptions/Readme.html | 77 ++++++++++++++++-------------- 1 file changed, 40 insertions(+), 37 deletions(-) diff --git a/Contrib/InstallOptions/Readme.html b/Contrib/InstallOptions/Readme.html index 87f646c9..298dfe62 100644 --- a/Contrib/InstallOptions/Readme.html +++ b/Contrib/InstallOptions/Readme.html @@ -479,50 +479,53 @@ value of a Field using ReadINIStr:

 ReadINIStr $R0 "$PLUGINSDIR\test.ini" "Field 1" "State"
 
-

     Important Note:

-

        For Multiline edit -boxe's the output "State" comes with "\r\n" if text as more -than one line and is your responsiblity to convert it inside script to -"$\r$\n" if needed! example macro:

-
NORMALIZE_CRCF VALUE
-  push $1 ; Index
-  push $2 ; Output char by char
-  push $3 ; Output char by char next
-  push $4 ; Text Accumulator
+

Note:

+

For Multiline edit boxes the output "State" comes with "\r\n" +if the text contains more than one line. You have to convert it to "$\r$\n" if needed, +using this macro:

+
!macro NORMALIZE_CRCF VALUE
 
-  StrCpy $1 "0"
-DONEXT:
-  StrCpy $2 ${VALUE} 1 $1
-  IntOp $1 $1 + 1
-  StrCpy $3 ${VALUE} 1 $1
-  StrCmp $3 "" EOT
-  StrCmp $2 "\" 0 NORMAL_CHAR
-  StrCmp $3 "r" FOUND_CR
-  StrCmp $3 "n" 0 NORMAL_CHAR
-;FOUND_LF:
-  StrCpy $4 "$4$\r"
-  IntOp $1 $1 + 1
-  goto DONEXT
+  ;Note: Do not use $R1-$R4 as value
 
-FOUND_CR:
-  StrCpy $4 "$4$\n"
-  IntOp $1 $1 + 1
-  goto DONEXT
+  Push $R1 ; Index
+  Push $R2 ; Output char by char
+  Push $R3 ; Output char by char next
+  Push $R4 ; Text Accumulator
 
-NORMAL_CHAR:
-  StrCpy $4 "$4$2"
-  goto DONEXT
+  StrCpy $R1 "0"
+  
+  DONEXT:
+    StrCpy $R2 ${VALUE} 1 $R1
+    IntOp $R1 $R1 + 1
+    StrCpy $R3 ${VALUE} 1 $R1
+    StrCmp $R3 "" EOT
+    StrCmp $R2 "\" 0 NORMAL_CHAR
+    StrCmp $R3 "r" FOUND_CR
+    StrCmp $R3 "n" 0 NORMAL_CHAR
 
-EOT:
-  StrCpy ${VALUE} $4
-  pop $4
-  pop $3
-  pop $2
-  pop $1
+    StrCpy $R4 "$R4$\r"
+    IntOp $R1 $R1 + 1
+    Goto DONEXT
+
+  FOUND_CR:
+    StrCpy $R4 "$R4$\n"
+    IntOp $R1 $R1 + 1
+    Goto DONEXT
+
+  NORMAL_CHAR:
+    StrCpy $R4 "$R4$R2"
+    Goto DONEXT
+
+  EOT:
+    StrCpy ${VALUE} $R4
+  
+    Pop $R4
+    Pop $R3
+    Pop $R2
+    Pop $R1
 
 !macroend
 
-
 

Validate the input

If you want to validate the input on the page, for example, you want to check whether the user has filled in