|
From: <xue...@us...> - 2003-08-13 20:59:06
|
Update of /cvsroot/popfile/windows
In directory sc8-pr-cvs1:/tmp/cvs-serv26013
Modified Files:
pfi-library.nsh
Log Message:
New function created to help validate the POP3 and GUI port selections.
Index: pfi-library.nsh
===================================================================
RCS file: /cvsroot/popfile/windows/pfi-library.nsh,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** pfi-library.nsh 10 Aug 2003 10:41:47 -0000 1.10
--- pfi-library.nsh 13 Aug 2003 16:35:55 -0000 1.11
***************
*** 214,217 ****
--- 214,263 ----
FunctionEnd
+ #--------------------------------------------------------------------------
+ # Installer Function: StrStripLZS
+ #
+ # Strips any combination of leading zeroes and spaces from a string.
+ #
+ # Inputs:
+ # (top of stack) - string to be processed
+ # Outputs:
+ # (top of stack) - processed string (with no leading zeroes or spaces)
+ #
+ # Usage:
+ # Push " 123" ; the strings "000123" or " 0 0 0123" will give same result
+ # Call StrStripLZS
+ # Pop $R0
+ #
+ # ($R0 at this point is "123")
+ #
+ #--------------------------------------------------------------------------
+
+ Function StrStripLZS
+
+ !define L_CHAR $R9
+ !define L_STRING $R8
+
+ Exch ${L_STRING}
+ Push ${L_CHAR}
+
+ loop:
+ StrCpy ${L_CHAR} ${L_STRING} 1
+ StrCmp ${L_CHAR} "" done
+ StrCmp ${L_CHAR} " " strip_char
+ StrCmp ${L_CHAR} "0" strip_char
+ Goto done
+
+ strip_char:
+ StrCpy ${L_STRING} ${L_STRING} "" 1
+ Goto loop
+
+ done:
+ Pop ${L_CHAR}
+ Exch ${L_STRING}
+
+ !undef L_CHAR
+ !undef L_STRING
+
+ FunctionEnd
#==============================================================================================
|