today I have a problem with Script.
Is TextInputStream not supported by Script Xojo ?
180 - UnresolvedType - Can’t find a type with this name.
If so, how can I read a file through script, then store it in memory and process it?
Ok, I resolved with LoadText function:
Var sFilesDaCriptare As String
Var encodedText As String
sFilesDaCriptare = LoadText("C:\Users\...\InProject\kmlArr")
Print(sFilesDaCriptare) //TEST READ JOB
encodedText = EncodeBase64(sFilesDaCriptare, 0)
Call SaveText("C:\Users\...\InProject\k", encodedText)
But now, oohh, EncodeBase64 ? how can i make it work in the script?
Well it depends. If you need this to work in the IDE script editor, you’ll need to write one yourself. If this is for your own apps through XojoScript you should create a context class which contains the functionality that you need.
Hi Greg, what I was trying to automate is:
1 insert before the Build (in Navigator-Build Settings) my script
2 the script encodes some files if I create the Build, it does nothing if I am in Debug mode
Inside my program code I have:
#If DebugBuild Then
Var xmlA As String = fileA
Var xmlA As String = DecodeBase64(fileA)
Why do I use Encode64 in Debug mode? Because it allows me to work / modify the contents of the files (filesA, filesB, …) and then test my program if it works correctly (obviously these files are an integral part of my program and are processed when needed).
At build time, I would encrypt these files with Encode64 (not encryption, I know, but more than enough for now; crypto will be used in the future.)
Before going into the XojoScript documentation study, is it possible to do with Script?
Or do I create a second helper program to call before creating the main program Build ?
- I run the support program that “encodes” the files
- I run the main program to create the Build (so the main program already finds the files “encoded” by the support program)