Forum Replies Created
- AuthorPosts
- Jean ValleeParticipant
On 3/5/2013 2:04 AM, JV wrote:
> I just spent two hours looking for a coding error that may not even be
> there.
>
> Project won't compile. Strange error msgs that don't tell me anything
> useful.
>
> Comment out the include statement for the sma file I had been working
> on. Project compiles.. so the hunt is on.
> Uncomment include statement and start looking…
>
> I comment out one function at a time (and there are MANY) and compile.
> No joy. I started to become concerned when I got to functions I know
> were working yesterday.
>
> I have now commented out the ENTIRE file and STILL it won't compile.
> THIS MAKES NO SENSE!
>
> I will start a new sma and copy one function at a time to it and
> compile. This will take a LOT of time and that is something I do not
> have to spare.
>
> Jean ValleeFollow up…
In the IDE it shows the code as being all commented out.
But I open that sma in Notepad and it is not.
I guess a failed compile also fails on save?
Jean
Jean ValleeParticipantOn 3/4/2013 1:03 PM, Neil Robinson wrote:
> On 01/03/2013 18:49, JV wrote:
>> I imported db1util and SBLDateLib source code to try to track down my
>> error 17 when converting a known date field to a string.
>>
>> Project compiles but will not go into debug.
>>
>> I get parsing errors on both libraries.
>>
>> What can I do to get past this?
>>
>> Jean Vallee
>>
>
>
> There are updates to both of these and you may have the updated libraries from our session, but not the source. There will be a
> new release in the next day or two, so everything should be on the same footing. At that point, you ought to be able to use the
> libraries for debug.
>
> Ciao, NeilI'll keep an eye out for it…
Yes I have noticed that the sml's do not match the source code smj's..
Very confusing when trying to track something down.It would be helpful to include which sma's are included in an sml in the
next doc update.Jean Vallee
Jean ValleeParticipantOn 3/4/2013 12:54 PM, Neil Robinson wrote:
> On 04/03/2013 15:40, JV wrote:
>> I am getting an unexplainable error 22
>> The IDE reports:
>>
>> Error (22): Local variable not dimensioned
>> Error: a statement of function "wxdialog.processmodal" was executed
>> unsuccessfully
>>
>> The d.processmodal(.inf) is in a function is called over and over again.
>> It creates a wxform d to hold various dialogs for users to make a
>> choice. Some dialogs have radio buttons and some have listboxes along
>> with an ok and cancel button. The dialogs all display and allow
>> selection correctly.
>>
>> This error is ONLY raised if a listbox in the dialog allows for multiple
>> selections.
>>
>> The error occurs immediately when the user clicks the OK button after
>> choosing multiple items on the listbox. It does it whether the user
>> selected one or selected multiple items on the list.
>>
>> I commented out the code that allows for multiple selection and the code
>> that fed the selected items into an array to make sure that the array
>> for the listbox items being fed to the dialog was correct.
>>
>> It works fine in single item select only mode although I'm pretty sure
>> that commenting the 2nd part about feeding the selected list items into
>> an array was not needed. It never gets there. The previous statement is
>> processmodal and that's where it crashes and burns.
>>
>> Any ideas how to fix this?
>
> Hi Jean,
>
> This may be crashing on the processmodal() because further down the line,
> in the code that handles the onclick event there is a problem. Have you
> passed a reference variable but not allowed for it in the parameter list
> of the function?
>
> Ciao, NeilThe code is exactly the same for both single and multiple selection list
boxes.I have an:
if app.gsw == 120
… set selection to multiple
else
… set selection to single
end ifwithin the function that creates the dialog.
The selections made in the listbox are not even evaluated until after
processmodal so it should not matter how many there are.If app.gsw == 120 (allow multiple choices) I declare and initialize an
array to read them into else I declare a string to accept the single
choice immediately following processmodal.But I never get to it when multiple choice are allowed…
Do I need to declare and initialize the array maybe before the dialog
function and its setting for allowing multiple choices?
I am going to try that… now that I put that idea in writing.Not intuitive but an option to try…
Jean Vallee
Jean ValleeParticipantOn 3/1/2013 10:25 PM, jim wrote:
> Here is where event driven, multi-threaded programming comes into its own.
> '
> In the fast-forward (or fast-reverse) routines, the logic goes something
> like this:
> '
> If fastselection is true
> get a record
> display the record
> wait for a little bit
> go back and do it again.
> '
> So, in your stop or pause button code, which is handled as an onclick
> event handler for those buttons, you simply have a line that says:
> '
> fastselection = .false
>
I added fastselection = .false to the onclick function but it made no
difference.Then I tried the old fashioned way
while e <> 64
appw.form.selectnext(error=e)
end whileIn both instances, the system did not respond to my pause or stop
buttton functions which contain appw.form.selectcurrentWhen in ffwrd or rewind mode, I get an hourglass if that tells you
anything…Jean Vallee
Jean ValleeParticipantOn 3/1/2013 11:12 PM, jim wrote:
> With specific exceptions, I will create a function for a chunk of code
> that I use more than once. The reasons are that it makes controlling
> functionality MUCH simpler; if I need to modify the functionality of that
> segment of code, changing it in one place changes that functionality
> everyplace, and it inevitably leads to a more compact executable. In this
> era of big memory, compactness isn't necessarily that important, but I'm
> very old-school that way. There is additional processor overhead in
> calling a function, but the impact is not even measurable for most
> purposes most of the time, so I ignore the overhead.
>
> The exceptions are those cases where the additional overhead DOES matter
> (never an issue in Simpol), or a situation where the identity in function
> is coincidental and there is no good reason why that functionality should
> remain identical (thus, I might well make a change here but not there), or
> under circumstances where I simply don't realize I have identical segments
> of code because the amount of time between when I coded here and when I
> code over there is sufficient that I have forgotten what I did earlier.
>
> Following this philosophy has given me, to date, a total of 891 functions
> (based on counting the "end function" statements) in my current project.
> I expect to add roughly another 40-50 by the time the product reaches the
> market.
>
I have started to create functions for common tasks like setting an
index on a primary file. I can see where it is helpful to do this even
though it's more work to set it up initially. I will have to write the
functions as I go and rewrite the sections where I did not use the
snippet. That is a task I can assign to my QA person when he starts
reviewing the code. I only have 156 functions so far and I'm only about
1/4 of the way thru.Do you have a release date for your system?
I meant to ask you when we talked by phone… will you be changing your
price point with the new release?As always, THANKS for your help!
Jean ValleeJean ValleeParticipantOn 2/27/2013 3:00 PM, Neil Robinson wrote:
> On 26/02/2013 14:32, JV wrote:
>> Can you please tell me what setting fastselection to .true does?
>> I know when to use it but not what it is for.
>>
>> Thanks!
>> Jean Vallee
>>
>
> This should only be used by the selectrecord function when it is in a fast forward or rewind loop. It is a flag that is set by the
> loop and the loop continues until the flag is set to .false. Close examination of the code that handles the normal selections,
> plus the code that calls that on behalf of the fastformward or rewind may clarify the usage. It is not really meant for external
> use, unless you can't find a way to call the existing functions.
>
> Ciao, NeilI am replicating the old SB panel complete with pause and stop (which
the current tool bar does not have)..I'm trying to figure out how to interrupt the ffwrd and rewind
functions. Thought maybe fastselection was related to the fact that my
pause and stop buttons have no effect.I'll have to give this some more thought…
Jean ValleeParticipantOn 2/27/2013 4:26 PM, JV wrote:
> On 2/27/2013 3:06 PM, Neil Robinson wrote:
>> On 27/02/2013 14:39, JV wrote:
>>> On 2/27/2013 8:39 AM, JV wrote:
>>>> Is there any reason VAL no longer works? – generates object not found
>>>> error.
>>>>
>>>> string2val does work.. but I have VAL lots of places in code that is
>>>> already debugged.
>>>>
>>>> Jean Vallee
>>> I actually meant that string2val does not generate an error.
>>> But it does not return a value either … it returns .nul
>>>
>>> string answer, response
>>> integer valueofanswer
>>>
>>> answer = getuserinput("Please enter the permit number you want to look
>>> up.. (Enter the number only…)", sAPPTITLE,"", response, .false)
>>>
>>> // User enters a number… number for testing is 475 a known good value
>>>
>>> valueofanswer = 0
>>> valueofanswer = string2val(answer)
>>>
>>> // This returns. nul and not an integer whose value is 475
>>>
>>> Any ideas?
>>
>> Not currently, though an update to these functions was done today to
>> cope with the unusual case of someone passing a minus sign in
>> the wrong place. That is now corrected for in the same way as multiple
>> decimal points are covered.
>>
>> You can easily create a simple test program using just db1util.sml and
>> call the function. You can also debug what is going wrong
>> by adding the source from the sb1util project to your test program.
>> Could it be you ave failed to pass something to the function
>> that is required and are therefore getting back a .nul result? For
>> details about debugging into library source code, see chapter 3
>> of the IDE Tutorial.
>>
>> Ciao, Neil
>>
> I'll give that a shot.. I just can't see what is wrong at the moment.
> been looking at it too long today, I guess.I added db1util to the project and got this when I compiled:
Error: parsing failure in function "string2val"
Error after the following source code line:
C:SIMPOL173ProjectsLibsdb1utildb1utildb1util.sma(1068): integer e, pNot sure I can fix this one.. please advise..
Thanks!
Jean ValleeJean ValleeParticipantOn 2/27/2013 3:06 PM, Neil Robinson wrote:
> On 27/02/2013 14:39, JV wrote:
>> On 2/27/2013 8:39 AM, JV wrote:
>>> Is there any reason VAL no longer works? – generates object not found
>>> error.
>>>
>>> string2val does work.. but I have VAL lots of places in code that is
>>> already debugged.
>>>
>>> Jean Vallee
>> I actually meant that string2val does not generate an error.
>> But it does not return a value either … it returns .nul
>>
>> string answer, response
>> integer valueofanswer
>>
>> answer = getuserinput("Please enter the permit number you want to look
>> up.. (Enter the number only…)", sAPPTITLE,"", response, .false)
>>
>> // User enters a number… number for testing is 475 a known good value
>>
>> valueofanswer = 0
>> valueofanswer = string2val(answer)
>>
>> // This returns. nul and not an integer whose value is 475
>>
>> Any ideas?
>
> Not currently, though an update to these functions was done today to cope with the unusual case of someone passing a minus sign in
> the wrong place. That is now corrected for in the same way as multiple decimal points are covered.
>
> You can easily create a simple test program using just db1util.sml and call the function. You can also debug what is going wrong
> by adding the source from the sb1util project to your test program. Could it be you ave failed to pass something to the function
> that is required and are therefore getting back a .nul result? For details about debugging into library source code, see chapter 3
> of the IDE Tutorial.
>
> Ciao, Neil
>
I'll give that a shot.. I just can't see what is wrong at the moment.
been looking at it too long today, I guess.Jean ValleeParticipantOn 2/27/2013 8:39 AM, JV wrote:
> Is there any reason VAL no longer works? – generates object not found
> error.
>
> string2val does work.. but I have VAL lots of places in code that is
> already debugged.
>
> Jean Vallee
I actually meant that string2val does not generate an error.
But it does not return a value either … it returns .nulstring answer, response
integer valueofansweranswer = getuserinput("Please enter the permit number you want to look
up.. (Enter the number only…)", sAPPTITLE,"", response, .false)// User enters a number… number for testing is 475 a known good value
valueofanswer = 0
valueofanswer = string2val(answer)// This returns. nul and not an integer whose value is 475
Any ideas?
Jean Vallee
Jean ValleeParticipantOn 2/25/2013 3:20 PM, Neil Robinson wrote:
> On 23/02/2013 21:34, JV wrote:
>> How do I find out which control has focus at any given time when using
>> dataform1?
>>
>> I know how to find the first focusable one and how to setfocus.
>>
>> I have searched the docs for the equivilent of SB's order variable but
>> came up empty.
>>
>> Jean Vallee
>>
>
> wxform.focuscontrol will contain a reference to the control that currently has focus. If you are using dataform1 forms, then it
> will be this:
>
> form.currentpage.wxformpage.focuscontrol
>
> To get from that control to the dataform1 control, you have to retrieve the reference from the control._ property.
>
> Ciao, NeilI knew it was in there somewhere! Thanks!
Jean ValleeParticipantOn 2/19/2013 11:27 AM, jim wrote:
> In Simpol, it is a local form property: f.setcursor("wait") then
> f.setcursor("") to restore.
>
> Since it is a local form property, it only works when a form is open and
> it only works when the mouse cursor is over the form. So it does not work
> to provide an activity indicator when starting up.
>
> I am sure that the Windows mechanism for doing this can be accessed, but I
> have not investigated that.
>
> Easiest just to pop a requester on startup with a progress bar on it that
> says "starting up", periodically update that progress bar, then close that
> requester when you are ready to go. The function CreateMeter (which is in
> the libraries someplace… gaugelib, I believe) will do that for you.
>
As this is something more than one of us would like to know, I am
willing to start the research on how to access this windows function.
I'm spending a lot of time waiting for my app to come up and it would be
helpful to inform my users they need to be patient…Jean ValleeParticipantOn 2/19/2013 3:48 PM, Neil Robinson wrote:
> On 19/02/2013 13:51, Jean Vallee wrote:
>> I spent the better part of yesterday tracking this down.
>>
>> Have a bitmap button… when clicked generates an error 200.
>> rechecked all code and location of bitmap. I use the same image (a PNG
>> file) for all 4 states.
>>
>> Changed button to straight pushbutton.. same name and function called…
>> no error…
>>
>> This button and 7 others like it are replicated on 12+ forms so I need
>> to get it working…
>>
>> Any ideas?
>>
>> Jean Vallee
>>
>
> An error 200 can occur if you have failed to use the correct type in the correct place. In your event handling function, did you
> tell it the first parameter is a dataform1bitmapbutton, or did you tell it it was a dataform1button? If the latter, that would
> explain it.
>
> Ciao, Neil
Ahh!!! bitten by a dataform1bitmap! First time using it.. learning as I go.
Thanks!
JeanJean ValleeParticipantOn 2/18/2013 2:32 PM, kromkowski wrote:
> I can't seem to find this in the documentation.
>
> Between the starting of an application and the first window and form
> being opened up there can be a second or 2 (or 10). I'd like to change
> the mouse pointer to "hourglass" or whatever we are calling the circle
> loading thing. So that the user knows thing are starting and does
> impatiently start more and more instances of the program.
>
> how do I do that?
>
> Thank youI'd like to know too!
Jean ValleeJean ValleeParticipantOn 2/18/2013 8:48 AM, JV wrote:
> On 2/18/2013 12:30 AM, jim wrote:
>> me =@ appw.form
>> // what is me now? hover says dataform1button –
>> // watch also says dataform1button – but appw.form = dataform1
>> .
>> .
>> I would expect you to get a "wrong type" error at runtime from this
>> statement. Me has been defined as a type dataform1button, and now you are
>> trying to assign a dataform1 to it. Why would you want to do that?
>>
>> Remember the point of object-orientation is to encapsulate types and
>> properties in order to prevent errors. What you are doing here is
>> explicitly ignoring that paradigm and attempting an assignment across
>> types.
>>
>> Error 28 is "string too long".
>>
>> Your program *should* bomb on that assignment statement with a wrong type
>> error; if it isn't then that is a bug in the runtime environment, but
>> regardless internal assignments are happening incorrectly and you are
>> overflowing something.
>>
>
> Of course… duh! That's what's I get for writing code 12 hrs a days for
> days on end! Too tired to see it.
>
> Thanks for being my second pair of eyes!
> JeanNope.. even after making me a dataform1 all is ok until the refresh
command.. still getting the error 28.Revised code:
called from a form button
function AddTblRecd(dataform1button b, appwindow appw)
integer e ; e=0
datetime d
d =@ datetime.new()
d.setnow()
plv_application app
app =@ appw.app ;// app has usernamedataform1 me
me =@ appw.form// what is me now? me is dataform1
me.newrecord(error=e)
me.preventfocus = .false
// insert date and username
me.masterrecord.record!LastUpdt = d
me.masterrecord.record!UpdtBy = app.username// ALL OK TO HERE //
// me.refresh();// getting an error 28 here!!!
type(dataform1control) fc
fc =@ findfirstfocusablecontrol(me)fc.setfocus()
end function
I thought this might still be a problem when an appw.form.refresh()
statement also generated an error 28.However, since this is a new record, can refresh even be used? I need it
to show the date and username I added to the record.What else can I try? I'm ready to test my validation function but can't
unless I get a new record successfully.Jean
Jean ValleeParticipantOn 2/18/2013 12:30 AM, jim wrote:
> me =@ appw.form
> // what is me now? hover says dataform1button –
> // watch also says dataform1button – but appw.form = dataform1
> .
> .
> I would expect you to get a "wrong type" error at runtime from this
> statement. Me has been defined as a type dataform1button, and now you are
> trying to assign a dataform1 to it. Why would you want to do that?
>
> Remember the point of object-orientation is to encapsulate types and
> properties in order to prevent errors. What you are doing here is
> explicitly ignoring that paradigm and attempting an assignment across
> types.
>
> Error 28 is "string too long".
>
> Your program *should* bomb on that assignment statement with a wrong type
> error; if it isn't then that is a bug in the runtime environment, but
> regardless internal assignments are happening incorrectly and you are
> overflowing something.
>Of course… duh! That's what's I get for writing code 12 hrs a days for
days on end! Too tired to see it.Thanks for being my second pair of eyes!
Jean - AuthorPosts