Westy, you're too nice to defile anythingSo while you can defile alias names as nick has stated
objects or structures in PicBasic?
Aw. Beat me to it!Westy, you're too nice to defile anything
led0.pin = B.0 : led0.pause = 1000
led1.pin = B.1 : led1.pause = 1500
Do
bPtr = led0 : Gosub FlashLed
bPtr = led1 : Gosub FlashLed
Pause 100
Loop
#Picaxe 18M2
Symbol reserveW0 = w0 ' b1:b0
Symbol reserveW1 = w1 ' b3:b2
Symbol led0 = 4 ' b4
Symbol led0.time = w2 ' b5:b4
Symbol led0.pause = w3 ' b7:b6
Symbol led0.pin = b8 ' b8
Symbol led1 = 10 ' b10
Symbol led1.time = w5 ' b11:b10
Symbol led1.pause = w6 ' b13:b12
Symbol led1.pin = b14 ' b14
led0.pin = B.0 : led0.pause = 1000
led1.pin = B.1 : led1.pause = 1500
Do
bPtr = led0 : Gosub FlashLed
bPtr = led1 : Gosub FlashLed
Pause 100
Loop
FlashLed:
b0 = @bPtrInc : b1 = @bPtrInc
b2 = @bPtrInc : b3 = @bPtrInc
w0 = w0 + 100
If w0 >= w1 Then
w0 = w0 - w1
Toggle @bPtr
End If
bPtr = bPtr - 3
@bPtrDec = b1 : @bPtr = b0
Return
This is a forum that is, for PICAXE microcontrollers as produced by Revolution Education together with questions on associated items used in projects with PICAXE chips.The PICAXE Forums have been designed to facilitate the flow of useful, appropriate and fun information about the PICAXE system.
Yes, you can build structures in a crude sense but all storage is public, although you can elect to keep RAM quasi-hidden from routines... only subroutines since PICAXE Basic does not support functions. To get an idea of how such things can be coded, you may wish to refer to a couple of my blog posts:Is it possible to define objects or structures in PicBasic?
Something along the lines of...
Code:Object Id = b0 length = b1 nameab = w1 namecd = w2 nameef = w3 namegh = w4 End Object
Although a little late,Thank You Everyone for your help,
And its PicAxe-Basic I meant and not PicBasic.
Merry Christmas To You All Too!
Zaf