Okay. I tried it again, and this time worked. I went to %APPDATA%\PureBasic\Templates.prefs and found this as the new contents:
Code: Select all
TEMPLATES:1.0
Template: Begin
Code: EnableExplicit\nGlobal a.l, b.l, c.l, d.l, e.l, f.l, g.l, h.l, i.l\nGlobal aa.s, bb.s, cc.s, DD.s, ee.s ff.s, gg.s\n\nProcedure.l rinstr(ofs.l, str1.s, str2.s)\n Protected a.l, b.l\n If ofs<1 Or ofs>Len(str1) \n a=Len(str1)+1\n Else\n a=ofs\n EndIf\n a-Len(str2)\n If a>0\n For b=a To 1 Step -1\n If Mid(str1,b,Len(str2))=str2\n ProcedureReturn b\n EndIf\n Next\n EndIf\n ProcedureReturn 0\nEndProcedure\n
Where you see "\n" above, that is a new line flag, like using the Enter key.
If you don't recognize %APPDATA%, that holds "c:\Documents and Settings\<user name>\Application Data", which is a specific folder on your system. If you have PureBasic copied into another folder besides \PureBasic, it will
share what it finds in %APPDATA% with the original, unless you designate a different folder for Templates.
APPDATA is one of the environmental settings which you can check from the Command line by using "set", or
that you can check inside your program by using a set if functions whose names are:
Code: Select all
ExamineEnvironmentVariables() ;must be called first
Repeat
NextEnvironmentVariable() ;needs to be called, even for the first environmental variable
If EnvironmentVariableName() = "APPDATA"
Env.s = EnvironmentVariableValue()
Break
EndIf
Until EnvironmentVariableName() = ""
Note that "set" is a good way to find the names and current values of all the environmental variables,
and if you did something like set APPDATA = \PureBasic\AppData you could change one, or do a
set APPDATA = with a blank after it, and you remove that variable from the set altogether. Not to be
played with lightly, although if you change the environmental variables in a program, once the program
is exited, the set is restored to what it was before the program was called.