Forum > Third party

Еличка - a simple calculator with history

<< < (2/4) > >>

Roland57:
@Gustavo,CM630

Thanks for the answer. I should have seen that.  :)

Unfortunately, the project in its current state cannot be compiled under Linux.

Regards.

Roland

CM630:
A slightly modified version is committed to SVN, I hope it will compile in Linux now.
If it does not, maybe commenting the subs below will be enough:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---function GetNumLock: boolean;var  KeyState : TKeyBoardState;  NLState: integer;begin   GetKeyboardState(KeyState);   NLState:=KeyState[VK_NUMLOCK];  if{ ((NLState = 0) or (NLState = 128))  or} ((NLState = 1) or (NLState = 129))  then Result := True else Result := False;end;  procedure SetNumLock(SetOn: boolean);begin   if ((GetNumLock = true) and (SetOn = false))   or ((GetNumLock = false) and (SetOn = true)) then   begin //toggles numlock     Keybd_Event(VK_NUMLOCK, 69, KEYEVENTF_EXTENDEDKEY, 0);     Keybd_Event(VK_NUMLOCK, 69, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0);   end;end;  

I suppose that the EXE will work in Wine, anyway.

AlexTP:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---  if{ ((NLState = 0) or (NLState = 128))  or} ((NLState = 1) or (NLState = 129))  then Result := True else Result := False;
Result:=   ((NLState = 1) or (NLState = 129))

Zoran:

--- Quote from: CM630 on March 28, 2022, 09:14:27 am ---
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---   if ((GetNumLock = true) and (SetOn = false))   or ((GetNumLock = false) and (SetOn = true)) then 
--- End quote ---

Sorry, I cannot resist...
Yes it works, but it is so ugly. You can do better than that.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if GetNumLock xor SetOn then
You could also replace "xor" with "<>" if you prefer. But at least, please don't use "= true" and "= false".

On the other hand, you can add as many "= true" as you want, it would also work:

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if ((((((GetNumLock = true) = true) = true) = true) and (((SetOn = false) = true) = true) = true)  or (((((GetNumLock = false) = true) = true) = true) and (((SetOn = true) = true) = true) = true)) = truethen 

CM630:

--- Quote from: Zoran on March 28, 2022, 09:36:47 am ---You can do better than that.

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---if GetNumLock xor SetOn then
--- End quote ---
I do it your way when I get of fit of laziness, but these fits happen rarely.,

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version