Hello Guest it is March 28, 2024, 07:38:03 PM

Author Topic: Macros, Visual Basic and all that  (Read 7008 times)

0 Members and 1 Guest are viewing this topic.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Macros, Visual Basic and all that
« Reply #10 on: September 23, 2007, 06:16:43 AM »
Hi Jim

do while condition
  statements
loop

missing an "end if"

last "End" keyword if used at all should come after the main code and before the subs. i.e.

main code  statements
End

Subs

Me thinks maybe you're more used to C than this VB abomination :-)
« Last Edit: September 23, 2007, 06:19:09 AM by stirling »

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Macros, Visual Basic and all that
« Reply #11 on: September 23, 2007, 06:30:35 AM »
also just noticed your presradius decrement is = instead of -
and
StartRadius never used and PresRadius never initialized
« Last Edit: September 23, 2007, 06:51:27 AM by stirling »

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Macros, Visual Basic and all that
« Reply #12 on: September 23, 2007, 06:54:55 AM »
Speaking for my Dad :- Whoops!!!!! It was an eroor with while and wend...... I have now fixed it working okay...
Not me driving the engine - I'm better looking.

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Macros, Visual Basic and all that
« Reply #13 on: September 24, 2007, 07:24:06 AM »
Thanks Stirling - I was away yesterday, running the railway, and also thinking about it, and realised that I had not written the code correctly with while and wend, and if and end if and I wondered if that was where the fault lay. I telephoned my daughter who was also working on the same prog, and she sorted it - it works OK now.

Yes - Vis Basic is completely new - my last major brush with code was Pascal (some years ago) and recently some Microchip PIC chip programming for a signalling system.

The trouble is you are always playing catch-up. Still - Mach3 is first class, and has - and will - make a big difference to my engineering.

Jim
Not me driving the engine - I'm better looking.

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: Macros, Visual Basic and all that
« Reply #14 on: September 24, 2007, 08:23:46 AM »
pleased you got it all sorted Jim. Yes VB/VB script - what can I say... it turned cat skinning into an art form ;D