The following warnings occurred:
Warning [2] Undefined array key 227504 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227507 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227508 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227509 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227510 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227511 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227518 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227526 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227527 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227557 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227560 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227569 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227600 - Line: 275 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 275 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $thread - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $fid - Line: 295 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 295 errorHandler->error_callback
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227510 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227557 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227518 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227527 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined array key 227600 - Line: 331 - File: inc/plugins/threaded_mode.php PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php 331 errorHandler->error_callback
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 332 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 304 ThreadedMode::buildtree
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $theme - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Trying to access array offset on value of type null - Line: 3 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 3 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Undefined variable $lang - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks
Warning [2] Attempt to read property "messages_in_thread" on null - Line: 5 - File: inc/plugins/threaded_mode.php(305) : eval()'d code PHP 8.1.2-1ubuntu2.14 (Linux)
File Line Function
/inc/class_error.php 153 errorHandler->error
/inc/plugins/threaded_mode.php(305) : eval()'d code 5 errorHandler->error_callback
/inc/plugins/threaded_mode.php 305 eval
/inc/plugins/threaded_mode.php 23 ThreadedMode::showthread_threaded
/inc/class_plugins.php 142 threaded_mode_showthread_threaded
/showthread.php 918 pluginSystem->run_hooks





HP39GII and local functions



#6

One interesting thing with the 39gII is that you can define local functions in a program.

An exemple is given in the User's guide (p.247) but it seems there is an error :

Local functions 39gII

As Tim wrote in the previous link,a local function must be define before to be used in another program.

This seems logic but the user's guide confuses me, and perhaps this message can avoid another users to lose time to understand

Edited: 23 July 2012, 8:04 a.m.


#7

Thanks Gilles for this valuable tip!! I am ashamed to admit that I was unaware of local functions for the HP39gII. I guess I did not look at the manual much.

Namir


#8

Hi !

I just start reading the documentation of the HP-39gII and I discover that programming is powerful.

Programs allow high level structured code, use of local variable as well as local functions, global variable share with the user and also specific variable from system-application...

In one hand access to the global variables (organized in real, complex, lists, matrix/vector) make it easy to share or bring results to the user. In the other hand, the local variables and functions allow easy development of complex application free of any worries about how to organize data and code.

In addition, it seems really easy to use pre-definite Application-Key, plots or data tables or to predefine Application-Views. Manly due to the fact that pre-define application variable are documented and accessible (read/write) from user-applications.

This make quite powerful, complete and capable advanced calculator!

Exploring all its capabilities, make me believe that the shifted EEX-key, the lack of no Reverse Polish Logic or Notation are only details of small effect and of no weight when considering the power, capabilities and easy programming.

Keep in mind that I have not tested all the sharing possibilities (since I only test it on the emulator). But, for sure the SEND, CLONE and other command will make easy to transmit, share data, results as well as functions or user-applications with other HP-39’ owners.


Edited: 23 July 2012, 11:34 a.m.


#9

Quote:
This make quite powerful, complete and capable advanced calculator!

Exploring all its capabilities, make me believe that the shifted EEX-key, the lack of no Reverse Polish Logic or Notation are only details of small effect and of no weight when considering the power, capabilities and easy programming.


Makes me happy to hear things like that. :-)

TW

#10

Quote:
Programs allow high level structured code, use of local variable as well as local functions, ...

The TI-92 had all this already more than 15 years ago ... ;-)

Franz


#11

Quote:

The TI-92 had all this already more than 15 years ago ... ;-)

Franz


But one of the selling points of HP-39gII is speed. With the calculator benchmark, we know that HP-39gII is approximately 96 times faster than TI-89 HW2 (no data is available for TI-92) considering that HP-39gII is an economical model on par with TI-85/86 in terms of functionality.

Edited: 24 July 2012, 12:01 a.m.

#12

Quote:
Exploring all its capabilities, make me believe that the shifted EEX-key, the lack of no Reverse Polish Logic or Notation are only details of small effect and of no weight when considering the power, capabilities and easy programming.

I agree with everything you said except the lack of RPL. I could see myself using this machine for programming (it really does seem powerful though I only used the emulator) but I really can't get myself to use algebraic for basic, quick calculations. Which is something I do a lot at work.
Would it be possible to add a RPL calculator as an app? Just a 50g-style unlimited stack and basic scientific operations...

Cristian

#13

Hello,

The revision 1 version of the manual was a bit light on the programming details. Revision 2 was greatly improved (but still needs more work for some of the more advanced stuff).

Which one are you looking at?

TW

Edited: 23 July 2012, 11:43 a.m.


#14

Hi TIm

I use the version 2 User's Guide - May 2012

Page 247, you can read :

************************
EXPORT ROLLMANY(n,sides)
BEGIN
LOCAL k,roll;
// initialize list of frequencies
MAKELIST(0,X,1,2*sides,1)=> L2;
FOR k FROM 1 TO n DO
ROLLDIE(sides)+ROLLDIE(sides)=> roll;
L2(roll)+1=> L2(roll);
END;
END;

ROLLDIE(n)
BEGIN
RETURN 1+ FLOOR(RANDOM(N));
END;
******************************

This don't work because the ROLLDIE must be define before to be used(and a typo error with n and N in ROLLDIE). Must be :

******************************
ROLLDIE(n)
BEGIN
RETURN 1 + FLOOR(RANDOM(n));
END;

EXPORT ROLLMANY(n,sides)
BEGIN
LOCAL k,roll;
// initialize list of frequencies
MAKELIST(0,X,1,2*sides,1)=> L2;
FOR k FROM 1 TO n DO
ROLLDIE(sides)+ROLLDIE(sides)=> roll;
L2(roll)+1=> L2(roll);
END;
END;
*******************************


Edited: 23 July 2012, 5:57 p.m. after one or more responses were posted


#15

Thanks, appreciated!

TW

Edited: 23 July 2012, 5:58 p.m.

#16

Quote:
As Tim wrote in the previous link,a local function must be define before to be used in another program.

actually, you can do a forward declaration, just like in C...
put the name of the function followed by a ';'

cyrille


#17

Hi Cyrille,
Or like the FORWARD in PASCAL. Interesting and sometime essentiel (cross recursivity).

I have a question about local variables.

Are they local to each functions, or to the whole program ?
In another words, can I do that in the same program :

MyLocalFunction
BEGIN
LOCAL a,b,c;
...
END;

EXPORT MyGlobalFunction
BEGIN
LOCAL a,e,f;
...
END;

And if I can, does that means that my 'a' in MyLocalFunction has nothing to do with my 'a' in MyGlobalFunction ?

PS : another question ... Local variable must be declared but without 'type'... Is there a way to know the type of a variable ? Like the VTYPE in the 50G ? Could be interesting to write functions wich works with multiple types (kind of polymorph function)


Edited: 24 July 2012, 5:10 a.m.


#18

Code:

b:="B initial";

TEMP1()
BEGIN
LOCAL a;
a:="A";
b:="b";
PRINT(a);
PRINT(b);
END;

EXPORT TEMP(c)
BEGIN
LOCAL a:=c;
PRINT(a);
PRINT(b);
TEMP1();
PRINT(a);
PRINT(b);
END;

There are a few interesting things here.

On first run, the terminal would have:

B initial
<c input>
A
b
<c input>
b

The next time you run however, the first printed item will be "b". You can have variables that stay around by declaring them outside a program scope. Every function or routine in that program file will be able to use b as a variable. Other programs will not. I believe the content of b also stays around when you power cycle.

So the EXPORT keyword turns it into something recognized anywhere in the system, a non-exported variable outside of a scope will be available to anything in the program file (the file itself is the scope), and something inside of a function is limited to that specific function.

As for type...yeah, oops. We kind of forgot to include that. :-(

Nice thing is it only takes a short time to code it (probably an hour or so for something this simple) and it is fully integrated into the system. To define a system function/variable you provide: a name, getter/evaluator, setter (if a variable), min args, max args, algebraic priority, enabling of automatic input processing including list processing for specific agrumnts, whether it requires full qualification (C1 versus Statistics_2Var.C1 - eg. global or not), special printing if needed, Help, Menu id, and special printing for 2d mode (sigma or the like).

Then you have a new function that will work properly everywhere - including the help interface, placement in the appropriate menu location and even will handle special printing in 2d display mode!

Contrast that with adding a built in function to the 50g ROM. Might take anywhere from a week to much more depending on quite a few factors.

TW


Edited: 24 July 2012, 1:37 p.m.


Possibly Related Threads…
Thread Author Replies Views Last Post
  HP Prime - local variables retain their initial type BruceH 4 1,819 11-10-2013, 12:42 PM
Last Post: Michael de Estrada
  [41CL] New Extra Functions version Monte Dalrymple 0 1,084 11-08-2013, 04:32 PM
Last Post: Monte Dalrymple
  HP Prime: in need of help with defining functions Alberto Candel 14 4,185 10-27-2013, 10:48 AM
Last Post: Alberto Candel
  HP Prime Programming Tutorial #1: LOCAL, RETURN Eddie W. Shore 6 2,945 10-26-2013, 08:42 PM
Last Post: Miguel Toro
  HP39gii Richard Berler 1 1,318 10-23-2013, 12:10 AM
Last Post: WALTER B
  HP Prime Programming: LOCAL Alberto Candel 3 1,485 10-07-2013, 01:31 AM
Last Post: cyrille de Brébisson
  HP Prime spreadsheet functions SanS 0 1,876 10-04-2013, 04:23 AM
Last Post: SanS
  Stats functions on the HP34S Nicholas van Stigt 5 1,952 09-24-2013, 02:45 AM
Last Post: Nick_S
  Trig Functions Howard Owen 11 3,411 09-16-2013, 02:53 PM
Last Post: Fred Lusk
  50g piecewise functions Kurt Fankhauser 6 2,295 09-15-2013, 08:01 PM
Last Post: Kurt Fankhauser

Forum Jump: