Forums › Forums › SIMPOL Programming › datepicker & RunTIme
- This topic has 4 replies, 3 voices, and was last updated 10 years, 9 months ago by Ian Macpherson.
- AuthorPosts
- June 22, 2013 at 3:32 pm #74Ian MacphersonParticipant
Hello to all Anybody else come across this please ? I have 4 functions where I use a datepicker for a starting date & another for an ending date. They work fine in the IDE be it in single-user or PPCS mode As soon as I transfer to Run Time ( again be it in single-user mode or PPCS) I can type the starting date fine but as soon as I change the month value or the year value for the ending date the datepicker screen goes blank & that’s it At one stage in the IDE while debugging I did get an error 15 Object is already in use I know Mr Kromkowski uses the datepicker for starting & ending dates Could he tell me please if he has gone to Run Time with this thanks PS I’m running in XP When you use datepicker in the IDE or in RunTime to get just a starting date all works fine All the best Ian Macpherson
June 24, 2013 at 9:58 am #1513MichaelKeymasterOn 22/06/2013 16:32, Ian Macpherson wrote:
> Hello to all Anybody else come across this please ?
> I have 4 functions where I use a datepicker for a starting date & another
> for an ending date.
> They work fine in the IDE be it in single-user or PPCS mode
> As soon as I transfer to Run Time ( again be it in single-user mode or
> PPCS)
> I can type the starting date fine but as soon as I change the month value
> or the year value for the ending date the datepicker screen goes blank &
> that's it
>
> At one stage in the IDE while debugging I did get an error 15 Object is
> already in use
> I know Mr Kromkowski uses the datepicker for starting & ending dates
> Could he tell me please if he has gone to Run Time with this thanks
> PS I'm running in XP
> When you use datepicker in the IDE or in RunTime to get just a starting
> date all works fine
> All the best Ian Macpherson
>That sounds like a timing issue, if you are getting object in use in the runtime but not in the IDE. It may be that you are trying
to make use of an object in some way where you haven't fully released it yet.Ciao, Neil
June 24, 2013 at 2:16 pm #2267JD KromkowskiParticipantI presume that by "Run Time" you mean running the created .smp with the
Simpol Windows Program Loader.I do not have any problem with the datepicker either on Windows XP or
Windows 7 64-bit.How exactly are these functions getting called?
I do use the datepicker() directly in an onnewrecord function but at
some point I started using getdate() for start and end dates – (no sense
in reinvented the wheel Neil already invented).dStart = getdate(defdateformat="MMM dd,yyyy",captiontext = "Pick a Start
date.")By the way, when I am testing I create a shortcut for the .smp so I am
testing right away the the "run time". Only when I get an error (or if
I'm trying to figure how something works) do I use the IDE to execute or
debug the program.(Oh and ever since I made sure that the curser was not over the IDE
window when I compile, I do not have IDE crashes – so there is obviously
a conflict between the compiler and the part of the IDE that monitors
cursor position.)JDK
On 06/24/13 5:58 AM, Neil Robinson wrote:
> On 22/06/2013 16:32, Ian Macpherson wrote:
>> Hello to all Anybody else come across this please ?
>> I have 4 functions where I use a datepicker for a starting date & another
>> for an ending date.
>> They work fine in the IDE be it in single-user or PPCS mode
>> As soon as I transfer to Run Time ( again be it in single-user mode or
>> PPCS)
>> I can type the starting date fine but as soon as I change the month value
>> or the year value for the ending date the datepicker screen goes blank &
>> that's it
>>
>> At one stage in the IDE while debugging I did get an error 15 Object is
>> already in use
>> I know Mr Kromkowski uses the datepicker for starting & ending dates
>> Could he tell me please if he has gone to Run Time with this thanks
>> PS I'm running in XP
>> When you use datepicker in the IDE or in RunTime to get just a starting
>> date all works fine
>> All the best Ian Macpherson
>>
>
> That sounds like a timing issue, if you are getting object in use in the runtime but not in the IDE. It may be that you are trying
> to make use of an object in some way where you haven't fully released it yet.
>
> Ciao, Neil
>July 3, 2013 at 7:12 am #2268Ian MacphersonParticipantthanks to Mr Kromkowski for his interest.
Actually the code is completely yours as done in your payroll app and by
RunTime I mean effectively the stand alone version with the program
looader.
Actually I made a mistake on my machine the second datepicker crashes be
it in the runtime stand alone OR the IDE & it does it at the end of the
ChgDate function after me.form.setcontainer(.nul) & the last line
setcontainer(dlg)
I finally ended up using Jean Vallées way of doing it with a dialog form
using 2 datepickers calling 2 functions rather than putting the two
datepickers one after the other and it works fine
Though why the first one would work & not the second time around is beyond
me
Thank you for the getdate() hint Will have a look tomorrow
All the best to all on the forum
Ian Macpherson
PS It took me 8 months but I think the transfer to SIMPOL is done & hope
to install end July Champagne !!! ( with thanks to Neil for his
patience & help)July 15, 2013 at 2:36 pm #1403JD KromkowskiParticipantThat payroll app was just a quick prototype. It worked at the time. But
at some point I switched to getdate() and actually using a form
something like this which allows for choosing by Month, Quater or Custom
Date using getdate()include 'uisyshelphdr.sma'
function main()
wxform f
type(wxformcontrol) fc
integer e; e = 0
wxdialog d
syscolors colors
sysrgb btnface
wxfont deffontcolors =@ syscolors.new()
btnface =@ colors.getsyscolor(COLOR_BTNFACE)f =@ MonQuartDial(e)
if f !@= .nul
deffont =@ getdefaultfont()d =@ wxdialog.new(100,100, innerwidth=f.width, innerheight=f.height,
captiontext="Hello", visible=.false,
stdbuttons="ok", error=e)
d!ok.onclick.function =@ MonQuarter
if d !@= .nul
f.setcontainer(d)
d.processmodal(.inf)
end if
d.onvisibilitychange.function =@ MonQuarter
d!ok.onclick.function =@ MonQuarter
d.setvisible(.false)
end if
string test, sel
test = f.firstcontrol.name
sel = ""
fc =@ f.firstcontrol
while sel == ""
if fc.state == "on"
sel = fc.name
else
fc =@ fc.next
end if
end while
end function selfunction MonQuarter(type(*) me)
string test
test = "something"
if me.name == "ok"
test = "ok"
me.dialog.setvisible(.false)
end if
end functionfunction MonQuartDial(integer error)
wxform f
wxfont font1
type(wxformcontrol) fc
integer e, dpix, dpiy
number factor
type(wxgraphic) fg
wxformoptiongroup Quarterfont1 =@ wxfont.new(facename="MS Shell Dlg 2", pointsize=8,
style="n", weight="n")
Quarter =@ wxformoptiongroup.new()e = 0
dpix = 0; dpiy = 0
getdpivalues(dpix, dpiy)
factor = dpix / 96
f =@ wxform.new(width=400 * factor, height=250 * factor,error=e)
if f =@= .nul
error = e
else
f.setbackgroundrgb(0xffffff)
fg =@ f.addgraphic(wxgraphicrectangle, point1=point.new(30 *
factor, 32 * factor), point2=point.new(370 * factor, 230 * factor),
rgb=0xf0f0f0, borderrgb=0x0, visible=.false, bordervisible=.true,
name="rectangle71", borderwidth=1, error=e)
fc =@ f.addcontrol(wxformoption, 41 * factor, 41 * factor, 70 *
factor, 31 * factor, "Quarter 1", name="Q1",error=e)
if fc !@= .nul
//fc.setstate("on")
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 41 * factor, 77 * factor, 70 *
factor, 31 * factor, "Quarter 2", name="Q2", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 41 * factor, 113 * factor, 70 *
factor, 31 * factor, "Quarter 3", name="Q3", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 41 * factor, 185 * factor, 70 *
factor, 31 * factor, "Full Year", name="Q5", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 199 * factor, 41 * factor, 70 *
factor, 31 * factor, "February", name="2", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 199 * factor, 77 * factor, 70 *
factor, 31 * factor, "May", name="5", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 199 * factor, 113 * factor, 70 *
factor, 31 * factor, "August", name="8", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 199 * factor, 149 * factor, 70 *
factor, 31 * factor, "November", name="11", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 120 * factor, 113 * factor, 70 *
factor, 31 * factor, "July", name="7", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 41 * factor, 149 * factor, 70 *
factor, 31 * factor, "Quarter 4", name="Q4", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 278 * factor, 113 * factor, 70 *
factor, 31 * factor, "September", name="9", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 278 * factor, 149 * factor, 70 *
factor, 31 * factor, "December", name="12", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 120 * factor, 77 * factor, 70 *
factor, 31 * factor, "April", name="4", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 120 * factor, 41 * factor, 70 *
factor, 31 * factor, "January", name="1", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 278 * factor, 41 * factor, 70 *
factor, 31 * factor, "March", name="3", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 278 * factor, 77 * factor, 70 *
factor, 31 * factor, "June", name="6", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 120 * factor, 149 * factor, 70 *
factor, 31 * factor, "October", name="10", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformoption, 120 * factor, 185 * factor, 70 *
factor, 31 * factor, "Custom", name="Custom", error=e)
if fc !@= .nul
fc.onchange.function =@ MonQuarter
Quarter.addmember(fc)
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
fc =@ f.addcontrol(wxformtext, 48 * factor, 21 * factor, 103 *
factor, 22 * factor,
"Select Time Period", name="text72",
alignment="", error=e)
if fc !@= .nul
fc.setbackgroundrgb(0xffffff)
fc.settextrgb(0x0)
fc.setfont(font1)
end if
end if
end function fOn 07/03/13 1:12 PM, Ian Macpherson wrote:
> thanks to Mr Kromkowski for his interest.
> Actually the code is completely yours as done in your payroll app and by
> RunTime I mean effectively the stand alone version with the program
> looader.
> Actually I made a mistake on my machine the second datepicker crashes be
> it in the runtime stand alone OR the IDE & it does it at the end of the
> ChgDate function after me.form.setcontainer(.nul) & the last line
> setcontainer(dlg)
> I finally ended up using Jean Vallées way of doing it with a dialog form
> using 2 datepickers calling 2 functions rather than putting the two
> datepickers one after the other and it works fine
> Though why the first one would work & not the second time around is beyond
> me
> Thank you for the getdate() hint Will have a look tomorrow
> All the best to all on the forum
> Ian Macpherson
> PS It took me 8 months but I think the transfer to SIMPOL is done & hope
> to install end July Champagne !!! ( with thanks to Neil for his
> patience & help)
> - AuthorPosts
- You must be logged in to reply to this topic.