Recent

Author Topic: where to post new code for revision and sharing ? - TRegistryExtended  (Read 21841 times)

beefycoder

  • New Member
  • *
  • Posts: 24
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #15 on: December 10, 2010, 12:09:00 pm »
Ok thank you in advance. Take all the time needed. Do it once, do it right. And no more gray hair and lost sleep over updates :)

Robson

  • New Member
  • *
  • Posts: 47
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #16 on: December 10, 2010, 01:33:32 pm »
I already tried that. End result is

Code: [Select]
registryextended.pas(260,18) Error: Ordinal expression expected

On the line containing "case aRoot of" , where aRoot is of type string.

Maybe there is a compiler directive i don't know of that will make FPC "happy". So for now, this is how it works.

And i really don't want to get into wishlist given on that link, i work with IDE i got right now. Lazarus/FPC combo being a free alternative to Delphi with near complete feature set (there is always room for more) it is an offer hardly anyone can refuse.
var
CorNor : String;

      case AnsiIndexStr(UpperCase(CorNor), ['BLACK','WHITE','MAGENTA','RED','GREEN','BLUE','YELLOW']) of
        0 : ShowMessage('1');
        1 : ShowMessage('2');
        2 : ShowMessage('3');
        3 : ShowMessage('4');
        4 : ShowMessage('5');
        5 : ShowMessage('6');
        6 : ShowMessage('7');
      end;

beefycoder

  • New Member
  • *
  • Posts: 24
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #17 on: December 10, 2010, 04:57:19 pm »
Elegance in action ! Touché !  8-)

eny

  • Hero Member
  • *****
  • Posts: 1665
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #18 on: December 10, 2010, 05:34:36 pm »
...
 case AnsiIndexStr(...

And so we learn something every day: I had never before seen the exit(n) construct.
(It's used in the AnsiIndexStr function.)
According to the ref manual this is an ObjFPC special extension.
Very useful!
All posts based on: Win11; stable Lazarus 4_4  (x64) 2026-02-12 (unless specified otherwise...)

Robson

  • New Member
  • *
  • Posts: 47
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #19 on: December 10, 2010, 06:43:50 pm »
Sorry, I forgot the unit

unit strutils;

fabienwang

  • Sr. Member
  • ****
  • Posts: 449
  • Lazarus is the best
    • My blog
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #20 on: December 11, 2010, 06:18:54 pm »
Elegance in action ! Touché !  8-)

You're french? Touché is a french word =)
I'm using Arch Linux.
Known for: CPickSniff, OpenGrabby
Contributed to: LazPaint

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12899
  • FPC developer.
Re: where to post new code for revision and sharing ? - TRegistryExtended
« Reply #21 on: December 13, 2010, 03:31:45 pm »
According to the ref manual this is an ObjFPC special extension.

FPC in general (it is also visible in other modes). But Delphi adapted it in D2009.

 

TinyPortal © 2005-2018