PDA

View Full Version : plaese help explain such statement ABYTE.0[Index]=0, what is that mean



greatpic
- 9th April 2008, 11:01
I read a standard program, and can not understand this sentance

ABYTE VAR BYTE
INDEX VAR BYTE

FOR INDEX=0 TO 7
ABYTE.0[INDEX]=1 'what the "0" follow ABYTE mean? it is not a arry?
NEXT INDEX


ABYTE.0[INDEX], ABYTE[INDEX], ABYTE(INDEX) , they are the same?



I can not found any information about that, I think it is the way to change every bit of a byte, where is the rule?

great thanks

duncan303
- 9th April 2008, 11:32
Hi and Welcome

Take a look at this post it should help.
544


HTH :)

Duncan

greatpic
- 10th April 2008, 08:14
seemed lots of secret skill in PBP not in manual. any document about that mystery?



really appreciate your help

dhouston
- 10th April 2008, 10:27
While not offering any detail, the Repeat statement in the manual does demonstrate it.

duncan303
- 10th April 2008, 10:34
Hi

seemed lots of secret skill in PBP not in manual. any document about that mystery?

I do not agree that there is any mystery. Each time I read the manual I understand more clearly something that I had either brushed over or misunderstood. Personally I think the manual is written very well. yes, it is concise yes but remember it is a "reference" manual

and I do "misunderstanding" really well :) it's one of the most constant skills I have brought through my whole life.


If fact... hang on a second......... page 2 section 1.2


This Manual cannot be a full treatise on the BASIC Language.......... now I found that quote in a couple of seconds, I doubt I would have been albe to do so in something like Horowitxz for example. Just look at the linear shelf space taken up by manuals in your local high street, manuals explaining manuals referencing the main manual, quick tips, hot tips, concise, complete.........

The Beauty of PBP is it is stable (for me) and very easy to use, that doesn't mean the code we write with it cannot get horrendously complex.

Everybody (maybe) gets stuck sometimes, its natural, and thank god there is a place we all can come to get help.

Your welcome

Duncan

greatpic
- 11th April 2008, 07:11
While not offering any detail, the Repeat statement in the manual does demonstrate it.

I have the pbp manual , different version with you? I can not found the statment "repeat", while I found the word in it : )
1.2. About This Manual
This manual cannot be a full treatise on the BASIC language. It
describes the PicBasic Pro Compiler instruction set and provides
examples on how to use it.

mister_e
- 11th April 2008, 09:59
I have an ol' version of the manual.. for compiler version 2.47 (date 9/05). REPEAT is located in section 5.66

But yeah... it show they use it... but they don't explain anything

Online version show date 3/04, Repeat is still at 5.66, same... everything.

I didn't check the whole manual.. but here's my understand.. i'll do it once ;)

It's nothing more than another kind of fussy writing thing. Which perform some kind of text substitution thingy.

YourVar=4
Something.0[YourVar]=1

becomes Something.04=1

That's the easiest way i see to explain it... but yeah.... why it's like that? ... because :D

Kamikaze47
- 11th April 2008, 17:20
I'm not sure why they didn't just allow you do use VAR.BIT=0 instead of VAR.0[BIT]=0.

What would be nice is to be able to also do this: VAR[INDEX].BIT=0

I came across a situation just yesterday that required me to set a bit in a word, in an array to the same as another bit in another word in another array, so if it was allowed would be like this:

VAR1[INDEX].BIT=VAR2[INDEX].BIT

Instead of one line like above, it ended up being 5 lines.

No matter tho, theres always a way around these things.

greatpic
- 14th April 2008, 06:58
you are all so kind