Modulinos: Difference between revisions
Content added Content deleted
(Removed {{omit from|Go}}) |
m (→{{header|Phix}}: now builtin) |
||
Line 1,290: | Line 1,290: | ||
=={{header|Phix}}== |
=={{header|Phix}}== |
||
Here is a simple little dirty hack to do this. You can put the function in any file, but you have to call it from the right place. |
Here is a simple little dirty hack to do this. You can put the function in any file, but you have to call it from the right place. |
||
⚫ | |||
<lang Phix>function isMainOrInclude() |
|||
-- returns 1 if called from the main file, 0 if from an include |
|||
integer res |
|||
#ilASM{ |
|||
[32] |
|||
mov eax,[ebp+20] -- prev_ebp |
|||
mov eax,[eax+8] -- rtn |
|||
mov [res],eax |
|||
[64] |
|||
mov rax,[rbp+40] -- prev_ebp |
|||
mov rax,[rax+16] -- rtn |
|||
mov [res],rax |
|||
[] |
|||
} |
|||
return res=21 -- (21=T_maintls) |
|||
end function |
|||
⚫ | |||
=={{header|PHP}}== |
=={{header|PHP}}== |