Author Topic: Proposed Comment underlines.  (Read 3494 times)

0 Members and 1 Guest are viewing this topic.

Charles Pegge

  • Guest
Proposed Comment underlines.
« on: July 10, 2012, 10:04:32 AM »

Early versions of Oxygen supported:
----------
=======

as non executable lines. I would like to reintroduce this feature to make listings a little tidier.

three or more denotes non executable:

===this is a comment===

---this is also a comment---

================== and this

----------------------------- and this


Charles

Peter

  • Guest
Re: Proposed Comment underlines.
« Reply #1 on: July 10, 2012, 02:30:41 PM »
is not necessary, none needs this.

Aurel

  • Guest
Re: Proposed Comment underlines.
« Reply #2 on: July 10, 2012, 11:26:36 PM »
Hmm ...really i don't see for this might be useful for example.. ???

Charles Pegge

  • Guest
Re: Proposed Comment underlines.
« Reply #3 on: July 11, 2012, 12:01:56 AM »
I think I might need it. :)

Will see if it improves the appearance of code.

Charles

Code: OxygenBasic
  1.  
  2.   function DOS(string s)
  3.   ======================
  4.   string c
  5.   STARTUPINFO infs
  6.   PROCESS_INFORMATION infp
  7.   if s then c="cmd.exe /c" else c="cmd.exe"
  8.   CreateProcess null,c+s,0,0,0,0,0,0,@infs,@infp
  9.   CloseHandle infp.hProcess
  10.   CloseHandle infp.hThread
  11.   end function
  12.  
  13.  
  14.   function Exec(string c,s,a)
  15.   ===========================
  16.   STARTUPINFO infs
  17.   PROCESS_INFORMATION infp
  18.   if s="" then exit function
  19.   string d=c
  20.   if a then
  21.     d+=" "+a
  22.     putfile a,s
  23.   end if
  24.   CreateProcess c,d,0,0,0,0,0,0,@infs,@infp
  25.   CloseHandle infp.hProcess
  26.   CloseHandle infp.hThread
  27.   end function
  28.  
  29.  
  30.   'MICROSECOND TIMER
  31.  ==================
  32.   '
  33.  quad ts,te,freq
  34.   QueryPerformanceFrequency @freq
  35.   '
  36.  function Timer(quad*t)
  37.   QueryPerformanceCounter @t
  38.   end function
  39.   '
  40.  function TimeLapse(quad *ts,*te) as double
  41.   return (te-ts)/freq 'SECONDS
  42.  end function
  43.   '
  44.  
  45.   'KEYSHIFTS
  46.  ==========
  47.  
  48.  
  49.   function ShiftKey() as sys
  50.   return 0xffff and GetAsyncKeyState(VK_SHIFT)
  51.   end function
  52.  
  53.   function CtrlKey() as sys
  54.   return 0xffff and GetAsyncKeyState(VK_CONTROL)
  55.   end function
  56.  
  57.  
  58.   function IsAlphaNum(sys a) as sys
  59.   =================================
  60.   if ((a>47)and(a<58))or((a>64)and(a<91))or((a>96)and(a<123)) then return -1
  61.   end function
  62.  
  63.  
  64.   Function GetText(sys hwnd) as string
  65.   ====================================
  66.   sys le
  67.   bstring s
  68.   le=SendMessage hwnd,WM_GETTEXTLENGTH,0,0
  69.   s=nuls le
  70.   SendMessage hwnd,WM_GETTEXT,le+1,strptr s
  71.   return s
  72.   end function
  73.  

Aurel

  • Guest
Re: Proposed Comment underlines.
« Reply #4 on: July 11, 2012, 05:47:58 AM »
Hi Charles...
What exactly this program doing ?
From last function i see that calculate text lenght and gettext trough
Sendmessage command.
So what you mean ,maybe on this way faster loading or something else?

jack

  • Guest
Re: Proposed Comment underlines.
« Reply #5 on: July 11, 2012, 06:37:56 AM »
I like the idea, very handy

Peter

  • Guest
Re: Proposed Comment underlines.
« Reply #6 on: July 11, 2012, 07:15:24 AM »
That's not my style to write a program.  :D

Charles Pegge

  • Guest
Re: Proposed Comment underlines.
« Reply #7 on: July 11, 2012, 09:41:33 AM »

That was part of my IDE utility functions, Aurel. Probably not necessary to restrict length in WM_GETTEXT.

Charles