Hi Fangbeast
I'm sorry to hear that you are still indisposed.

We all hope that you can beat your illness too.
As to your program. I like the program idea 'your wife' influenced you to start, and it would be
nice to be able to finish it. But do it as you are able too. I'm sure others here could help you too.

What would be nice is to have a Project Topic added in the main list, where some could work
together on a project, offer suggestions, or to help complete it. I do not know very much about using
sqlite, and wouldn't probably venture that way. Although you can learn about using sqlite from what
others add.
But here is some code that you can use for 'any program' that gives you the program version info that
you were looking for.
In your programs code, at the top, enter this code:
Code: Select all
ver$="2.5"; you need to put the version # you want here.
;Create includes directory in Compiler Home directory, and use #PB_Compiler_Home as below.
IncludeFile #PB_Compiler_Home + "includes\cdt.pb"
vcdt$="Version: "+ver$+Chr(10)+Chr(10)+"Creation Date & Time: "+Chr(10)+cdt$;I use this with a MessageBox
In your programs main window, add this hot key, or just put vcdt$ in your version box w/o the Chr(10)'s.
(I just use the hot key method: Ctrl Alt v to open a MessageBox)
Code: Select all
;Put your #name of window here in place of #main_Window
AddKeyboardShortcut(#main_Window, #PB_Shortcut_Control|#PB_Shortcut_Alt|#PB_Shortcut_V, #CtrlAltv) ;vcdt$ view version date time
Create a directory in your purebasic folder called includes.
Compile the following code as CompileDateTime.exe and place
in your purebasic folder.
**** Directions for setting up as a tool are in the code. ****
This program creates the file cdt.pb in your \includes directory
(parts of this code was from others in this forum)
Code: Select all
;This program creates a Date Time file called cdt.pb, which can be included in your programs compiled exe
; Compile program With the name CompileDateTime.exe. To configure, click Tools > Configure Tools > Click New
; Now edit to something similar:
; Commandline: 'Browse' to "CompileDateTime.exe" (mine is: D:\PureBasic\CompileDateTime.exe )
;no args needed
;Working Directory: D:\PureBasic\
;Name: "CompileDateTime"
; Event To trigger the tool: Before Create Executable
; check Wait until tool quits and to prevent an annoying console from popping up every save, I have Run Hidden checked
;
;EnableExplicit ;I removed as too much hassle.
#C12HOUR = 12 ; silly constants, trying to pretend to be a clock!
#C24HOUR = 24
Procedure$ GetDate()
Protected Result$, gMonth, gDay$, gYear$, monthNames$
gMonth = Month(Date())
gDay$ = Str(Day(Date()))
gYear$ = Str(Year(Date()))
monthNames$ = "January|February|March|April|May|June|July|August|September|October|November|December"
; give each day ending with 1, 2, 3, 4... 23,24 etc their proper ordinal suffix
Select gDay$
Case "1", "21","31"
gDay$ + "st"
Case "2","22"
gDay$ + "nd"
Case "3","23"
gDay$ + "rd"
Default
gDay$ + "th"
EndSelect
Result$ = StringField(monthNames$, gMonth, "|") + " " + gDay$ + ", " + gYear$
ProcedureReturn Result$
EndProcedure
Procedure$ GetTime(const)
; depending on user settings, should this date be displayed as a 24 hour clock, or 12 hour?
; format 12 hour clock...
Protected gHour,gHour_n,gMeridiem$,gTime$
gHour.i = Hour(Date())
If const = #C12HOUR ; this is my crappy time conversion function which will add meridiem if the 12 hour clock is used
If gHour>= 13
gHour_n.i = gHour.i - 12
gMeridiem$ = "PM"
Else
If gHour.i = 0
gHour_n = 12
EndIf
gHour_n.i = gHour.i
gMeridiem$ = "AM"
EndIf
gTime$ = Str(gHour_n.i) + ":" + FormatDate("%ii:%ss",Date()) + " " + gMeridiem$
ProcedureReturn gTime$
ElseIf const = #C24HOUR
gTime$ = FormatDate("%hh:%ii:%ss",Date())
ProcedureReturn gTime$
EndIf
EndProcedure
pp$=GetPathPart(ProgramFilename())
;Debug pp$
If Right(pp$,1)<>"\"
pp$+"\"
EndIf
pp$=pp$+"includes\";now place this in includes dir
gtdate$=GetDate()
gttime$=GetTime(#C12HOUR)
dat$="last modified: " + gtdate$ + " at " + gttime$
CreateFile(1,pp$+"cdt.pb")
WriteString(1,"cdt$="+Chr(34)+dat$+Chr(34))
CloseFile(1)
yipes time flies got to go.
hope this is useful to you
yrreti