Watching the third video in the Xbasic-101 series. Working in the AlphaSports db. This is the code they show.
Dim F as P
F=form.load("invoice")
F.fetch.last()
F.show()
sleep(2)
F.close()
Things that have happened while playing with this. Using only the following lines of code,
F=form.load("invoice")
F.fetch.last()
The fetch.last automatically shows the form after fetching the last record, no show command needed.
Is this correct functionality, or is it bad programing. To me this code is saying F=form.load("invoice"),
therefore F.fetch.last() is the same as form.load("invoice").fetch.last This line gives the same results,
it fetches the last record before showing the form.
If you do this:
F=form.load("invoice")
F.fetch.last()
F.show() 'this command is not really needed, works the same with or without
sleep(2)
sleep(2)
all the sleep commands seem to be executed befort the form is shown, remove the sleep commands and the form is displayed with last record showing. I put the sleep commands after the F.show() to demonstrate they are executed first and they are cumulative. Why are they executing before the F.show()
This also works: shows form after going to last record.
form.load("invoice")
invoice.fetch_last()
Is this bad form, not going the pointer route?
On a simple command, is the pointer necessary? We all know the KISS rule.
Please give some feedback and your thinking on this. Am I learning bad programing?
Thank you,
John
Dim F as P
F=form.load("invoice")
F.fetch.last()
F.show()
sleep(2)
F.close()
Things that have happened while playing with this. Using only the following lines of code,
F=form.load("invoice")
F.fetch.last()
The fetch.last automatically shows the form after fetching the last record, no show command needed.
Is this correct functionality, or is it bad programing. To me this code is saying F=form.load("invoice"),
therefore F.fetch.last() is the same as form.load("invoice").fetch.last This line gives the same results,
it fetches the last record before showing the form.
If you do this:
F=form.load("invoice")
F.fetch.last()
F.show() 'this command is not really needed, works the same with or without
sleep(2)
sleep(2)
all the sleep commands seem to be executed befort the form is shown, remove the sleep commands and the form is displayed with last record showing. I put the sleep commands after the F.show() to demonstrate they are executed first and they are cumulative. Why are they executing before the F.show()
This also works: shows form after going to last record.
form.load("invoice")
invoice.fetch_last()
Is this bad form, not going the pointer route?
On a simple command, is the pointer necessary? We all know the KISS rule.
Please give some feedback and your thinking on this. Am I learning bad programing?
Thank you,
John
Comment