How to rewrite this type example ? lazarus / 21-General ---------------------------------------------------------------------- Re-searcher · 2021-05-06 14:08 Hi everyone, Congratulations to the designer for creating this Visual IDE and FPC I am translating a program from basic to Laz/FPC but have the following problem. The program does not know this example with type. Have an error by compiling. How can I rewrite this now? Type ConstMeta   Value As String   Startup As String End Type With best regards, Erik ---------------------------------------------------------------------- MarkMLl · 2021-05-06 15:00 Not knowing BASIC, but surely that's just a simple record containing two strings? MarkMLl ---------------------------------------------------------------------- Re-searcher · 2021-05-06 16:45 Thanks MarkMLl for the quick response the language was FreeBasic. Erik ---------------------------------------------------------------------- lucamar · 2021-05-06 16:48 If that type is the FreeBASIC one then yes, it's (more or less) the equivalent of a Pascal record: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i type  ConstMeta = record    Value: String;    Startup: String;  end; ---------------------------------------------------------------------- Re-searcher · 2021-05-07 11:54 Thanks lucamar for your answer. The program was for programming PIC and AVR MCU's But has no IDE for Linux , only for Windows. It is gcbasic and made in FreeBasic gcbasic has new keywords. http://gcbasic.sourceforge.net/Typesetter/index.php/Home Freebasic has no IDE and no designer like Lazarus in Linux. Geany has an IDE but no designer. I want to create a program with the designer and communicate with the PIC or AVR MCU (Microcontroller) https://en.wikipedia.org/wiki/Microcontroller With kind regards, Erik ---------------------------------------------------------------------- MarkMLl · 2021-05-07 12:55 Quote from: Re-searcher on May 07, 2021, 01:54:04 pmI want to create a program with the designer and communicate with the PIC or AVR MCU (Microcontroller) So what language are you trying to write in? Your OP said you were converting /to/ Pascal, but if you're asking how to program in BASIC you're not really in the right place. MarkMLl ---------------------------------------------------------------------- dseligo · 2021-05-07 13:42 Quote from: MarkMLl on May 07, 2021, 02:55:11 pmSo what language are you trying to write in? Your OP said you were converting /to/ Pascal, but if you're asking how to program in BASIC you're not really in the right place. Int the first post he said: QuoteI am translating a program from basic to Laz/FPC but have the following problem. By designer he probably means Lazarus' IDE (and visual design of forms). ---------------------------------------------------------------------- MarkMLl · 2021-05-07 14:43 Quote from: dseligo on May 07, 2021, 03:42:25 pmQuote from: MarkMLl on May 07, 2021, 02:55:11 pmSo what language are you trying to write in? Your OP said you were converting /to/ Pascal, but if you're asking how to program in BASIC you're not really in the right place. Int the first post he said: QuoteI am translating a program from basic to Laz/FPC but have the following problem. By designer he probably means Lazarus' IDE (and visual design of forms). I can see what he said, which is why I referred to his OP. So why's he complaining that his BASIC tools don't have "a designer"? MarkMLl ---------------------------------------------------------------------- lucamar · 2021-05-07 14:47 Quote from: MarkMLl on May 07, 2021, 04:43:43 pmSo why's he complaining that his BASIC tools don't have "a designer"? AFAICT, he's not complaining, he's explaining why he wants to move from BASIC to Pascal, to wit: because of our wonderful "designer" ---------------------------------------------------------------------- MarkMLl · 2021-05-07 15:14 Quote from: lucamar on May 07, 2021, 04:47:44 pmAFAICT, he's not complaining, he's explaining why he wants to move from BASIC to Pascal, to wit: because of our wonderful "designer" Well, in that case I think we unite in welcoming him. I was just a bit concerned by his "BUT..." :-) Obviously there's quite a few of us who've put work into getting Lazarus/FPC apps talking to microcontrollers, so he didn't really have to quote Wp at us :-) MarkMLl ---------------------------------------------------------------------- Re-searcher · 2021-05-10 16:09 @MarkMLl If the people deliver a piece of code, these people also expect a piece of code in return. The topic also said: How to rewrite this type example? You also wrote: So what language are you trying to write in? This furum is about pascal. So the basic language to Pascal. I couldn't do anything with your ordinary text file that you gave me. The only person who helped me is lucamar. The microcontroller that was just one example. This is because they now use it. I also built the interface between a microcontoller and a the PC by myself. I could also have said: an old CNC from 1966 with a PC. I have also done this inteface. Or a link between a PLC and a PC. Have even built an interface for this. Built an OBDII tool.. Modems built ..... Morse, telex, fax, packet radio Erik ---------------------------------------------------------------------- marcov · 2021-05-10 17:04 Quote from: Re-searcher on May 10, 2021, 06:09:25 pm@MarkMLl If the people deliver a piece of code, these people also expect a piece of code in return. This is not a FreeBasic forum. You can't expect people to know obscure Basic dialects here. Moreover, basic (record and other) syntax can be easily gained from 20 minutes of reading the reference manual.  Something I suggest to read anyway. ---------------------------------------------------------------------- Re-searcher · 2021-05-13 15:43 Hi everyone, My country language is not English but dutch. I am an old person and I have not had to work for a while now. It is not easy to learn a new computer language that is also written in English with new and incomprehensible words. The documentation that is in a language other than my country language The last 3 years at school I only had a calculator. In recent years, that has been head arithmetic. Back then, computers at school did not exist. This was my first PC: Commodore c64 (64kb) with data set 1530 (tape recorder) The only record I knew was  : PRESS PLAY AND RECORD ON TAPE Basic V2.0 This is the only basic I know. At work I learned PLC programming and assembler. This was the answer from MarkMLl. Not knowing BASIC, but surely that's just a simple record containing two strings? Then why can't MarkMLl write in pascal? Can't this person write in Pascal either ? I hope you now understand and have an understanding of old persons like me. Erik ---------------------------------------------------------------------- MarkMLl · 2021-05-13 16:23 Quote from: Re-searcher on May 13, 2021, 05:43:09 pmMy country language is not English but dutch. I am an old person and I have not had to work for a while now. It is not easy to learn a new computer language that is also written in English with new and incomprehensible words. The documentation that is in a language other than my country language I agree that it's regrettable that the language and documentation doesn't conform to your native language, but I suggest that you take that up with Wirth- who despite his appointment at ETH in Zurich designed the language using English keywords and has always documented it in English. QuoteThe last 3 years at school I only had a calculator. In recent years, that has been head arithmetic. Back then, computers at school did not exist. Calculator? You had a calculator while at school? You obnoxious young whippersnapper, when I was at school I was grateful to have a decent sliderule and mathematical tables and I didn't have access to a desktop computer until my fourth year at university. Now I know that /some/ schools had access to the county mainframe using a Teletype- ever seen one of those? or by mailing off coding forms to be punched onto cards- ever done that and had to wait a week for the syntax errors to be sent back to you? QuoteThis was my first PC: Commodore c64 (64kb) with data set 1530 (tape recorder) The only record I knew was  : PRESS PLAY AND RECORD ON TAPE Basic V2.0 This is the only basic I know. At work I learned PLC programming and assembler. So? Some of us had to do stuff like that using ladder diagrams or machinecode. On occasion I found myself waking up from a dream where I was disassembling Z80 in my head. Put another way, don't try the "I'm a poor old man" act around here, kiddo >:-) QuoteThis was the answer from MarkMLl. Not knowing BASIC, but surely that's just a simple record containing two strings? And? You could have found the example in any elementary text: I carefully gave you the two important terms RECORD and STRING, and if you drop the three terms 'pascal' 'record' 'string' into Google it gives you e.g. https://www.pascal-programming.info/lesson11.php hence the example Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Type      Str25    = String[25];        TBookRec =                         Record                                Title, Author, ISBN : Str25;                              Price : Real;                        End; Var    myBookRec : TBookRec;  Now that's using a "shortstring" which is allocated with a predefined maximum length, you'd more likely these days to do something like Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i Type      TBookRec =                         Record                              Title, Author, ISBN : String;                                Price : Real;                        End;  ...and leave the hard work to the compiler. QuoteI hope you now understand and have an understanding of old persons like me. Old? Bah... Look, hopefully we've got that one out of the way. Because of the way you phrased the question I found it very unclear as to what /exactly/ you were asking. If I caused offence and in particular if I wasted your time I'm sorry, but all of us here answer questions as best we can allowing that most of us are still actually working, so we have limited time to spoon-feed people who aren't up to using Google or haven't bothered to find an online book. MarkMLl ---------------------------------------------------------------------- Bart · 2021-05-13 16:51 Quote from: Re-searcher on May 13, 2021, 05:43:09 pmMy country language is not English but dutch. I am an old person and I have not had to work for a while now. It is not easy to learn a new computer language that is also written in English with new and incomprehensible words. The documentation that is in a language other than my country language Hoi Erik, Wellicht kun je ook terecht op het NLDelphi forum. Daar is ook een Lazarus sectie aanwezig. Kun je gewoon Nederlands praten. { Hi Erik, Perhaps you could goto to NLDelphi forum. It has a Lazarus section. You can talk Dutch there. } Bart ---------------------------------------------------------------------- Re-searcher · 2021-05-15 21:33 Hi MarkMLl In the early years when I started working, punched cards was also used. I have also seen large mainframes with large tape recorders. Teletype terminals (VT ...) I had a punched card to register at the factory (time registration) punched card was also used as a means of payment. A street organ with a punched card. Erik ---------------------------------------------------------------------- Re-searcher · 2021-05-15 21:36 Hey Bart, Bedankt voor het bezorgen van de link Ik zie U wel op dat forum. Hi Bart {Thanks for sending me for the link I'll see you on that forum.} Erik ---------------------------------------------------------------------- MarkMLl · 2021-05-16 08:11 Quote from: Re-searcher on May 15, 2021, 11:33:42 pmTeletype terminals (VT ...) :-) No, not VT but the entirely-mechanical ones... ASR33 and the like. "Métal hurlant" :-) MarkMLl ---------------------------------------------------------------------- winni · 2021-05-16 09:37 Quote from: MarkMLl on May 16, 2021, 10:11:37 amQuote from: Re- searcher on May 15, 2021, 11:33:42 pmTeletype terminals (VT ...) :-) No, not VT but the entirely-mechanical ones... ASR33 and the like. "Métal hurlant" :-) MarkMLl Hi! For the "young blood": https://www.pdp8online.com/asr33/asr33.shtml Winni ---------------------------------------------------------------------- MarkMLl · 2021-05-16 09:48 :-) I might still have a set of the manuals somewhere. The bottom line is that the only electrical devices were a motor, a single electromagnet for printing, and a rotating commutator on the keyboard. One man could carry one- unlike the Olivetti I owned once which had been carefully "reimagined" to circumvent the patents and which replaced every pressed-metal part with a machined-and-bolted subassy which could easily drift out of alignment... I heard that the maintenance course was 12 weeks. It's difficult to imagine terminals which predate microprocessors, but "glass teletypes" with varying degrees of sophistication and ingenuity go back to the 1960s. @Re-searcher: you /really/ don't want to get me going on this stuff :-) MarkMLl ---------------------------------------------------------------------- BobDog · 2021-05-16 10:10 Hello re searcher. I am no spring chicken either. Remember that pascal string and freebasic string are not the same thing. You need ansistring, or the switch for ansistring to get a reasonable representation. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i    {$H+}          // String is now an alias for AnsiString     type  ConstMeta = record    Value: String;    Startup: String;  end;   var s:ConstMeta;   begins.Value:='aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaa';s.Value:=s.Value+s.Value; s.Value:=s.Value+s.Valu e; s.Value:=s.Value+s.Value; s.Value:=s.Value+s.Value; s.Value:=s.Valu e+s.Value; writeln;writeln(s.Value); readln;end. ---------------------------------------------------------------------- Re-searcher · 2021-05-17 13:03 @BobDog Thanks for this information. @MarkMLl When I was born at the time, there were no computers and printers (asr33) This type of printer is not stored in my memory brain only Mechanical desktop typewriters not with electronic like asr33 I have learned to write with a pen with ink from a bottle. http://www.overdiep.nl/ink/inkhomed.html Erik ---------------------------------------------------------------------- MarkMLl · 2021-05-17 13:23 Quote from: Re-searcher on May 17, 2021, 03:03:04 pmThis type of printer is not stored in my memory brain only Mechanical desktop typewriters not with electronic like asr33 That contained NO ELECTRONICS. QuoteI have learned to write with a pen with ink from a bottle. http://www.overdiep.nl/ink/inkhomed.html Yes, and when I was at school the desks had inkwells next to each pupil and we used dip pens, none of these fountain pens or Biros. I lie: we had Biros in primary school, but after that were expected to learn how to do things properly. MarkMLl