:: مهندس متواجد ::
تاريخ التسجيل: Oct 2009
المشاركات: 92
|
|
نشاط [ mkks87 ]
قوة السمعة:0
|
|
08-01-2010, 09:07 PM
المشاركة 8
|
|
انا واحد شار على فى هدا الامر بس مش فاهمه ياريت حديفهمنى ايش بالزبط هدا الامر وهدا هو شرحه
LOOKUP Index,[Constant{,Constant...}],Var
The LOOKUP statement can be used to retrieve values from a table of 8-bit constants. If Index is zero, Var is set to the value of the first Constant. If Index is one, Var is set to the value of the second Constant. And so on. If Index is greater than or equal to the number of entries in the constant list, no action is taken and Var remains unchanged. The constant list can be a mixture of numeric and string constants. Each character in a string is treated as a separate constant equal to the character's ASCII value. Array variables with a variable index may not be used in LOOKUP although array variables with a constant index are allowed. Up to 255 (256 for 18Cxxx) constants are allowed in the list.
Example
FOR B0 = 0 TO 5 ' Count from 0 to 5
LOOKUP B0,["Hello!"],B1 ' Get character number B0 from string to variable B1
SEROUT 0,N2400,[B1] ' Send character in B1 to Pin0 serially
NEXT B0 ' Do next character
|