ArmA Extended Dll v1.00

Put ArmAExt folder into ArmA dir, for example:
E:\games\ArmA\ArmAExt\
Run run.bat.

Syntax:

1) Simple commands:
loadfile "01 :dll"                                      return dll version
loadfile "02 :ver"                                      return dll version
loadfile "03 :info"                                     return dll info
loadfile "04 :ArmaDir"                                  return Arma Directory
loadfile "05 :ArmaPath"                                 return Arma Path
2) File operations:
loadfile "06 :File.Write(""file"")@data"                return nothing
loadfile "07 :File.Append(""file"")@data"               return nothing
loadfile "08 :File.Delete(""file"")"                    return nothing
loadfile "09 :File.Exists(""file"")"                    return bool
3) String operations:
loadfile "10 :String.ToCharArray(""string"")"           return array of char
loadfile "11 :String.ToIntArray(""string"")"            return array of integer
loadfile "12 :String.ToLower(""string"")"               return string
loadfile "13 :String.ToUpper(""string"")"               return string
loadfile "14 :String.Copy(""string"", offset)"          return string
loadfile "15 :String.Copy(""string"", offset, count)"   return string
loadfile "16 :String.Length(""string"")"                return integer
4) DataBase operations:
loadfile "17 :File.SetVar(""file"",""varname"")@var"    return nothing
loadfile "18 :File.GetVar(""file"",""varname"")"        return var
loadfile "19 :File.RemoveVar(""file"",""varname"")"     return nothing
loadfile "20 :File.VarExists(""file"",""varname"")"     return bool
loadfile "21 :File.VarCount(""file"")"                  return integer

Example 1:
; write and execute script
GLOBAL_INC = 100 
call compile loadfile format["%1:File.Write(""data.sqs"")@%2",GLOBAL_INC, "hint ""Hello world!"""]
GLOBAL_INC = GLOBAL_INC + 1
[] exec "ArmAExt\files\data.sqs"

Example 2:
; database operations
GLOBAL_INC = 100 
call compile loadfile format["%1:File.SetVar(""data1.txt"", ""player name"")@""%2""",GLOBAL_INC, name player]
GLOBAL_INC = GLOBAL_INC + 1
~1
s = call compile loadfile format["%1:File.GetVar(""data1.txt"", ""player name"")",GLOBAL_INC]
GLOBAL_INC = GLOBAL_INC + 1
hint s

call compile loadfile format["%1:File.SetVar(""data1.txt"", ""num"")@%2",GLOBAL_INC, 101]
GLOBAL_INC = GLOBAL_INC + 1
~1
i = call compile loadfile format["%1:File.GetVar(""data1.txt"", ""num"")",GLOBAL_INC]
GLOBAL_INC = GLOBAL_INC + 1
hint str (i+1)

call compile loadfile format["%1:File.SetVar(""data1.txt"", ""fnum"")@%2",GLOBAL_INC, 101.546]
GLOBAL_INC = GLOBAL_INC + 1
~1
f = call compile loadfile format["%1:File.GetVar(""data1.txt"", ""fnum"")",GLOBAL_INC]
GLOBAL_INC = GLOBAL_INC + 1
hint str (f+10)

Remark:
GLOBAL_INC needed to avoid ArmA script cashing.

Copyright  2006-2007 Voyager

HomePage:   http://voyager.alfamoon.com
Support:    http://voyager.alfamoon.com/forum
E-Mail:     voyager06@gmail.com

