Hi Wayne,
Maybe try this, using "block ... end block"
procedure k107_init(byte in geo) is
case geo of
216: block const byte cmd[] = "?G216" end block
220: block const byte cmd[] = "?G220" end block
...
but I'm not sure cmd will still be available out of case's scope.
Cheers,
Seb
2009/6/10 Wayne Topa <[email protected]>
>
> Hi guys
>
> I am finally getting into creating the K107 library and have run into
> a lack of knowledge of JAL.
>
> In this case I am trying to get a procedure to initialize the K107
> backpack for one of 6 geometries. My inexperience in jal is showing as
> I can't get this compile. Suggestions for a better method would be
> appreciated.
>
> procedure k107_init(byte in geo) is
> case geo of
> 216: const byte cmd[] = "?G216"
> 220: const byte cmd[] = "?G220"
> 224: const byte cmd[] = "?G224"
> 240: const byte cmd[] = "?G240"
> 416: const byte cmd[] = "?G416"
> 420: const byte cmd[] = "?G420"
> end case
> for 5 using i loop
> serial_sw_write(cmd[i])
> end loop
> -- delay required when writing to K107 EEPROM
> delay_100ms(2)
> end procedure
>
> The error is 'cmd' previously defined.
>
> I have tries other code to get this done but want to cut the code down
> as much as possible. I still want to use this in a 12f675, while using
> the library.
>
> I am using the latest jallib-pack. You guys have been busy! I haven't
> caught up with all the mail list since my systems were down, but I'm
> getting there.
>
> Regards
>
> Wayne
>
> >
>
--
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---