Post Reply 
File problems due to lack two instructions. #INCLUDED ...
03-24-2017, 05:11 PM (This post was last modified: 03-26-2017 10:42 PM by compsystems.)
Post: #1
File problems due to lack two instructions. #INCLUDED ...
Hello I'm creating a project that has n files that contain few equal internal names, and the functions are called between them.

Please create the following two files, from the HPP-CK

A: The MAIN files of each file display a text string "NAME FILE MAIN"

prg1.main; [ENTER] RETURNS "prg1 main" // Expected output.
prg2.main; [ENTER] RETURNS "prg2 main" // Expected output.

B: the functionX files of each file show a list that calls the main function of its own file and the other.

prg1.functionX; [ENTER] RETURNS {"prg1 main", "prg2 main"} // Expected output.
prg2.functionX; [ENTER] RETURNS {"prg2 main", "prg1 main"} // Expected output.


FILE1 NAME: prg1
PHP Code:
EXPORT main()
BEGIN
 
return "prg1 main";
END;

EXPORT functionX()
BEGIN
 
return { mainprg2.main };
END;

//EXPORT ... 

prg1.functionX(); [ENTER] RETURNS "syntax error" // ok because prg2 has not yet been defined.


FILE2 NAME: prg2
PHP Code:
EXPORT main()
BEGIN
 
return "prg2 main";
END;

EXPORT functionX()
BEGIN
 
return { mainprg1.main };
END;

//export ... 

prg1.functionX(); [ENTER] RETURNS "syntax error" // Why?
or
prg2.functionX(); [ENTER] RETURNS "syntax error" // Why?

A trick, if you temporarily delete the path, it compiles successfully

PHP Code:
return { mainprg1.main }; 
-> [SAVE] OK
PHP Code:
return { mainmain }; 

then rewrite route
PHP Code:
return { mainprg1.main }; 
-> [SAVE] OK

The two files work fine, but think if there are several definitions, it is very laborious to perform the previous trick.

prg1.main; [ENTER] RETURNS "prg1 main" // ok
prg2.main; [ENTER] RETURNS "prg2 main" // ok

prg1.functionX; [ENTER] RETURNS {"prg1 main", "prg2 main"} // ok
prg2.functionX; [ENTER] RETURNS {"prg2 main", "prg1 main"} // ok

///////////////////////////////////////////

Now If you rename any of the files it is obvious that a syntax error is generated. Because the path is not found

prg2 -> prgM2

prg1.functionX; [ENTER] RETURNS "syntax error" // ok

But if you re-rename with the original names still showing syntax error, Why?

prgM2 -> prg2

prg1.functionX; [ENTER] RETURNS "syntax error" // ?



From this arises the need for two new cmds or headers

#INTERNAL: Internal name, not to depend on the name stored in the calculator or PC

#INCLUDED: File for compilation attached

FILE 1 NAME: 123ABCDEFRFR
PHP Code:
#INTERNAL prg1
#INCLUDED  prg2

EXPORT main()
BEGIN
 
return "prg1 main";
END;

EXPORT functionX()
BEGIN
 
return { mainprg2.main };
END;

// EXPORT ... 

FILE 2 NAME: 00000888
PHP Code:
#INTERNAL prg2
#INCLUDED  prg1

EXPORT main()
BEGIN
 
return "prg2 main";
END;

EXPORT functionX()
BEGIN
 
return { mainprg1.main };
END;

//export ... 

I am not the only one that creates independent programs or a single file
http://www.hpmuseum.org/forum/thread-722...ht=libmenu
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
File problems due to lack two instructions. #INCLUDED ... - compsystems - 03-24-2017 05:11 PM



User(s) browsing this thread: 1 Guest(s)