--- In [email protected], "brucexs" <bswit...@...> wrote:
>
> I uploaded an exe only with the following
>
>
> http://powerpro.webeddie.com/download/powerpro.exe
>
>
> -------------------------
> imports (file_expr) * // imports all functions
> -----------------------------
>
Thanks for Update.
-------------------------
imports (file_expr) * // imports all functions
-----------------------------
It's working fine.
btw, if file_expr contains &() expressions, an error occurs.
; ----------------------------
Imports (ScriptFolder ++ ?"\fname") func1, func2 ;; ok
Imports (?"&(ScriptFolder)\fname") func1, func2 ;; ok
Imports (ScriptFolder ++ ?"\fname") * ;; ok
Imports (?"&(ScriptFolder)\fname") * ;; error, Invalid file in imports
; ----------------------------
>
> You can create multi-line strings by ending a line with ???delim. The
> string is formed by all the text on the following lines (ignoring escape
> sequence) in the program, including the end of line carriage returns, until
> there is a line which starts with delim (case ignored). Any sequence of
> alphanumerics can be used as delim. Example:
> var = "stuff " ++ ???end
> line 1
> line 2
> end
> assigns "stuff line 1\rline 2\r" to var.
> You can use many ???delim strings and mix with ordinary continuation.
> messagebox ("ok", ???e1
> text of
> message
> e1, ???e2
> title
> of message
> e2 ;;+
> )
> -----------------------------------------------
>
The second tab character for indentation is translated into space.
; ---------------------------
Local str = ???EOT
Example of string
spanning multiple lines
EOT ++ ???EOT
using heredoc syntax
since PProVersion &(PProVersion) ;; \t\t -> \t{space}
EOT
Win.Debug(str)
str[?"(?m)^\s+"] = "" ;; trim tab-indent
Win.Debug(str)
; ---------------------------
It would be useful if indenting closing identifier and omitting spaces and tabs
at the beginning of each line are supported.
> Note that a statement's total max length is still around 525 chars.
>
> More general includes, general default arg, and multi-classes in one file are
> too much work.
>
> You can do primitive default for missing args at end like this:
>
> function test(musthave, optional, opt2)
> if (arg(0)<2) //arg(0) always set to number of args
> optional ="def"
> if (arg(0)<3)
> opt2 = "def2"
>
FWIW, I've used IfElse(expr, string1, string2) for Default parameters.
; -----------------------------
function test(musthave, optional, opt2)
optional = IfElse(optional != "", optional, "def")
;;...
; -----------------------------
However, if string1 or string2 is expressions, IfElse() always evaluates both
expressions. It seems different from Ternary operator( ? : ).
I'll try your suggestion.
Thanks!!