Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

In Micros 3700 anyone knows a global variable in memory where a value can be accumulated?

Status
Not open for further replies.

mvelazquez

Technical User
Mar 14, 2015
121
MX
In Micros 3700 anyone knows a global variable in memory where a value can be accumulated within a ticket.

The breakdown is as follows, can only receive up to 250 dlls per ticket and use the functionality currently TMED to limit them, but to go accumulating them, I have to write to a file and then consult it and think it's not the best way. This is because each time you use the TMED function all variables are cleared.

Code:
event tmed:102
	VAR ConfigFile       : A50       // File Name
    	VAR Buffer           : A256
    	VAR FilePosition     : N8        // Data Pointer
    	VAR FileHandle       : N5  = 0   // File handle

	Call Procesa_Consulta_Tipo_Cambio

	
 	IF @WSTYPE = 3
       		FORMAT ConfigFile AS "\CF\MICROS\ETC\dlls.txt"
    	ELSE
       		FORMAT ConfigFile AS "dlls.txt"
 	ENDIF
	
	FOPEN FileHandle, ConfigFile, READ
	FREAD FileHandle, Total_dlls   
	FCLOSE FileHandle

        //This is the variable that I want to accumulate
        [b]//SOMETING LIKE: @SOME_VARIABLE = Total_dlls = Total_dlls + @TNDTTL/Tipo_Cambio[/b] 
	Total_dlls = Total_dlls + @TNDTTL/Tipo_Cambio 
	
	
	if Total_dlls  > Tope_dlls

               ExitWithError "Solo se pueden recibir $", Tope_dlls, " Dolares"
	else
		FOPEN FileHandle, ConfigFile, WRITE
		FWRITE FileHandle, Total_dlls  
		FCLOSE FileHandle
	endif
	
endevent
 
Not sure If i understand, but if you declare the VAR outside the EVENT or SUB, it should be passed through each function. However when the a script is called again, the value for that var is empty. So the best way, might be to write it to a text file.
 
If you're not using the info lines for anything you can use one of them as a holding spot for each check.
 
That's true, Detail Check Area is useful, however, the Cashier will see this information and will print on the receipt if you do not clear it first.
 
It would be really nice if there was such a system variable but there isnt.

The easiest option would be to store the value in your own global variable by defining it outside the TMED event. Variables can be defined anywhere in the SIM file. If they are within an Event or Sub then they are local. If they are defined outside of these they are global.

NOTE: If you define your globably variable with an initial value then this variable will reset after each event.
eg.
var Gbl_Var_A : N9 = 0 // This variable will reset to 0 after each event.
var Gbl_Var_B : N9 // This variable will not reset after each event.

Also note that if the SIM file is redownloaded to the workstation due to any changes ALL global variables are reset.






Do you want some custom SIM scripts developed. Contact me via my website
 
Thanks for the feedback,

Yes, I have a global variable declared at the beginning of the code, but from what I see, each time the event is triggered, all code is executed, and the next time a TENDER MEDIA is used, it is rerun from scratch , thus losing all variables.

I'll change the code to read the details of the check and add the Media Tender who belong to this type.

Thanks for the support.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top