Hello world on a report

Post your Gambas programming questions here.
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Re: Hello world on a report

Post by stevedee »

grayghost4 wrote: Saturday 25th January 2020 2:42am ...If I just take your code and use it ... I have not learned anything ... I have to use your suggestion and implement them myself...
Yes, that's definitely the right attitude.
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: Hello world on a report

Post by grayghost4 »

I have not been able to do what I wanted with the report module.

But with your help I have been able to finish my check program and in the process learn a lot :)

I have posted the program again for comments and maybe someone else will learn some of the things I learned.

Thanks again to those that help !
Attachments
printchecksBk.tar.gz
(218.29 KiB) Downloaded 323 times
User avatar
cogier
Site Admin
Posts: 1118
Joined: Wednesday 21st September 2016 2:22pm
Location: Guernsey, Channel Islands

Re: Hello world on a report

Post by cogier »

Several things you could consider.

In the program the comma is a problem as you are using it as a Split Separator, consider saving with NewLines or my favourite character for this sort of thing "`". It's on the left of the "1" key on your keyboard, I have no idea what it is designed for. So now no need to worry about commas. :D

Code: Select all

Samplebankofamerica,Mrs. Jone Smith ,1234 Main Street      (555)123-7654,Home Town  State  Zipcode,0789000231,084332167,bankofamerica.jpg,23459
becomes

Code: Select all

Samplebankofamerica`Mrs. Jone Smith `1234 Main Street      (555)123-7654`Home Town  State  Zipcode`0789000231`084332167`bankofamerica.jpg`23459
Then use Split(Text,"`") to get your data.

If you have a load of TextBoxes, as in this case, you can give then the same Group name e.g. AllTextBoxes. This means that an event on any of the TextBoxes will be directed to one routine e.g. AllTextBoxes_Change(). You can use the Last keyword which holds all the data of the TextBox last used. Have a look at the 8 routines I have reduced to 1 in the attached.

You could use a ValueBox that only takes numbers and make the other change above and you could remove that routine as well. :D
printchecksBk_CO.tar.gz
(214.1 KiB) Downloaded 341 times
User avatar
grayghost4
Posts: 174
Joined: Wednesday 5th December 2018 5:00am
Location: Marengo, Illinois usa

Re: Hello world on a report

Post by grayghost4 »

thank you cogier for the feedback I was trying to find a separator that work and the accent mark look good.
Also thanks for the hint to the use of the Group uses , but I have assinged just the number fields to "NumberBoxes" and I like the code below , I think it is easer to read and self explanatory.
Public Sub NumberBoxes_keypress()  
  
  If IsDigit(Key.text) Then
  Else If key.Code = key.BackSpace Then  'continue allow key 
  Else If key.Code = key.Delete Then
  Else If Key.Code = Key.Left Then
  Else If Key.Code = Key.Right Then
  Else If Key.code = Key.Tab Then
  Else
    Stop Event  ' ignore all other keys 
  Endif

End
I will try switching them to value boxes. :D
Post Reply