HP Forums

Full Version: PPLX: A few extras that might have been in PPL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
A few little extras that mIght have been included in PPL
PPLX v0. 1 provides implementation limits and TYPE's.

 LOCAL CRID:="PPLX V0.1 © 2019 StephenG1CMZ";
 LOCAL SP:=" ";

 //Returns the type of the object:
 EXPORT TYPEREAL :=TYPE(3.1); //0: Real
 EXPORT TYPEINT  :=TYPE(#3);  //1: Integer
 EXPORT TYPESTR  :=TYPE("A"); //2: String
 EXPORT TYPECMPLX:=TYPE();   //3: Complex
 EXPORT TYPEMAT  :=TYPE([1]); //4: Matrix
 (inc vector)
 EXPORT TYPEERR  :=5;         //5: Error
 EXPORT TYPELST  :=TYPE({});  //6: List
 (inc set)
 EXPORT TYPEFUN  :=TYPE('X'); //8: Function
 EXPORT TYPEUNIT :=TYPE(1_m); //9: Unit
 //14.?: cas object. The fractional part is the cas type.
 EXPORT TYPEIDS  :={"HomeSet_Real","HomeSet_Integers","Main_String","HomeSet_Complex","HomeSet_Matrix","AppData_ErrorPrefix","HomeSet_List","HomeSet_CAS","Program_Function","Units_Unit1"}; //MIXED STRINGFROMID 

 //Implementation Limits-Runtime
 //(Empirical on Android unless stated)
 //NB workarounds may exist, eg to create larger strings
 EXPORT ImpINT:=2^(ImpINTb-1);//{default 32,max 64,Less 1 when signed}
 EXPORT ImpSTR:=32*1024;//64KB
  //NOTE: use of mat2list may require ImpLST instead
 EXPORT ImpMATSQ:= 141 ;   //141*141<20000 
 EXPORT ImpLST  := 10000;  //STATED
 EXPORT ImpMATSL:=MIN(ImpMATSZ,ImpLST);//safe limit if mat2list may be invoked 
 //Implementation Limits:Compiletime

  PRINT("Useful extras that might have been useful in PPL.");
  PRINT("Note that Implementation Limits may have workarounds.");
  //Many programs need this info

 //Return name of TYPE



    IFTE(DIM(SPTMP)<LL,SPTMP+" ",SPTMP);//extra space if odd

 EXPORT OutImpLimits()
 //Display Implementation Limits
  TEXTOUT_P(STRINGFROMID("Main_Program")+" "+STRINGFROMID("Toolbox_Limits")+" (PPL)",0,0);


Implementation limits were tested on the Android VC: The values applicable to actual calculators and older firmware may differ.
Reference URL's