I just added some of my most used functions into a file that I wouldn't find in the AppGameKit framework.
Though if you do see that there are functions in AppGameKit that I just replicated, please do tell me, I'd rather use built in functions than my own as it adds to the processing time.
functions.agc
function GetDateTimeNow()
Date$=GetCurrentDate()
//Print (Date$)
Time$=GetCurrentTime()
//Print (Time$)
ConCat$ = Mid(Date$,1,4) + Mid(Date$,6,2) + Mid(Date$,9,2) + Mid(Time$,1,2) + Mid(Time$,4,2) + Mid(Time$,7,2)
//Print (ConCat$)
endfunction ConCat$
function GetDateNow()
Date$=GetCurrentDate()
//Print (Date$)
ConCat$ = Mid(Date$,1,4) + Mid(Date$,6,2) + Mid(Date$,9,2)
//Print (ConCat$)
endfunction ConCat$
function GetTimeNow()
Time$=GetCurrentTime()
//Print (Time$)
ConCat$ = Mid(Time$,1,2) + Mid(Time$,4,2) + Mid(Time$,7,2)
//Print (ConCat$)
endfunction ConCat$
function RemoveSpaces(s_Line$)
s_Return$ = ""
s_Char$ = ""
i_Len_Line = len(s_Line$)
i_Count = 0
for i_Count = 0 to i_Len_Line
s_Char$ = mid(s_Line$,i_Count,1)
if not s_Char$ = " "
s_Return$ = s_Return$ + s_Char$
endif
next i_Count
endfunction s_Return$
function Ltrim(s_Line$)
s_Return$ = ""
i_LineLen = len(s_Line$)
i_Count = 0
s_Char$ = ""
b_GotFirstChar = 0
for i_Count = 1 to i_LineLen
s_Char$ = mid(s_Line$,i_Count,1)
if b_GotFirstChar = 0
if s_Char$ = " "
else
b_GotFirstChar = 1
s_Return$ = s_Return$ + s_Char$
endif
else
s_Return$ = s_Return$ + s_Char$
endif
next i_Count
endfunction s_Return$
function Rtrim(s_Line$)
s_Return$ = ""
s_Temp$ = ""
i_LineLen = len(s_Line$)
i_Count = 0
s_Char$ = ""
i_Pos = 0
b_GotFirstChar = 0
for i_Count = 1 to i_LineLen
i_Pos = i_LineLen - i_Count
s_Char$ = mid(s_Line$,i_Pos,1)
if b_GotFirstChar = 0
if not s_Char$ = " "
b_GotFirstChar = 1
s_Temp$ = s_Temp$ + s_Char$
endif
else
s_Temp$ = s_Temp$ + s_Char$
endif
next i_Count
i_LineLen = len(s_Temp$)
for i_Count = 0 to i_LineLen
i_Pos = i_LineLen - i_Count
s_Char$ = mid(s_Temp$,i_Pos,1)
s_Return$ = s_Return$ + s_Char$
next i_Count
endfunction s_Return$
function Trim(s_Line$)
s_Return$ = ""
s_Return$ = Ltrim(s_Line$)
s_Return$ = Rtrim(s_Return$)
endfunction s_Return$
function GetFileExtension(s_FilePath$)
s_FileExtension$ = ""
s_FileExtension$ = Mid(s_FilePath$,len(s_FilePath$) - 2, 3)
endfunction s_FileExtension$
function OpenWebConnection(s_Domain$)
WebCon = CreateHTTPConnection()
SetHTTPHost(WebCon, s_Domain$ , 0)
endfunction WebCon
function CloseWebConnection(WebCon)
CloseHTTPConnection(WebCon)
DeleteHTTPConnection(WebCon)
endfunction
function Wlog(s_Log$)
s_CurrentDir$ = GetCurrentDir()
i_FileID = OpenToWrite("/media/System.log", 1)
WriteLine(i_FileID, GetDateTimeNow() + ":" + s_Log$)
CloseFile(i_FileID)
endfunction