Recent

Author Topic: Pascal for VisualBasic users in the Lazarus wiki  (Read 24761 times)

engkin

  • Hero Member
  • *****
  • Posts: 3112
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #30 on: February 18, 2015, 02:16:44 pm »
I  tried this:
Code: [Select]
procedure on..click..
var
  i:integer;
begin
   showmsg (inttostr(i));
end;
The result was Zero.I tried it several times.
For some reason I thought the variables in fpc do not get initialized upon declaration and I expeted to receive a random number. Am I wrong or this zero is just a coincedence?

Local variables do not get initialized. They get random value (whatever value happen to be on the stack where they landed). For simple projects you'll get the same value if you do the same step (like clicking the same button several times). Try calling this event from another procedure(s). However, global variables are initialized to zero.

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 12202
  • FPC developer.
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #31 on: February 18, 2015, 02:57:32 pm »
Such workarounds are like saying "you should have used a safety net" when sb is lying dieing on the ground  >:D
What workaround? It's just a matter of settings.

Writing good code should not depend on extra settings and procedures. Such settings and procedures are then stopgaps for deficiencies in the language.

mangakissa

  • Hero Member
  • *****
  • Posts: 1131
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #32 on: February 19, 2015, 09:27:21 am »
Eventually speed is the most imported thing. Pascal applications are compiled and linked to work stand alone. AFAIK VB still needs his own library to work which is slower to work.

But I only know VB from 10 years ago.
Lazarus 2.06 (64b) / FPC 3.0.4 / Windows 10
stucked on Delphi 10.3.1

sam707

  • Guest
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #33 on: February 19, 2015, 11:13:45 am »
okay now can we leave this?

to all "basic" gas factory fans, check the links below... I use it instead of microsho(f)t dumb because it makes standalone executables and it is cross platform in some ways... and alike QB/VB

http://www.freebasic.net
http://sourceforge.net/projects/fbedit/

I personnally stopped programming big projects with basic as I bought Turbo Pascal on my amstrad CpC6128, IBM PC did not exist these old times. As soon as I could get a STRUCTURED language, with no lines numbers, goto, gosub, and all these disorganized craps (some think they are advantageous as long as they can't know another language deeply), I leaved 'basic' and found out it was just a toy for amateurs.

Nowadays I program with Qt C++, and Lazarus Free Pascal. And I swear you dont need anything else if you want to go PRO... even NOT java (security holes) Lazy slow PCode Dancer HAHAHA

N.B. = microsoft has always been good at business and making money, but not in deep PRO programming tools! Most of the BEST tools are made by passionate ppl, and for FREE
NOTHING CAN SUPERSEED NOR REPLACE PASSION!
« Last Edit: February 19, 2015, 12:13:04 pm by sam707 »

CM630

  • Hero Member
  • *****
  • Posts: 1340
  • Не съм сигурен, че те разбирам.
    • http://sourceforge.net/u/cm630/profile/
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #34 on: February 20, 2015, 07:05:52 am »
I cannot find a list of prefix conventions used in Lazarus (comboboxes are named cboSomething, labels are named lblSomething, etc.).
I have no idea how it is used in Delhi and Lazarus? Is it worth to create such a page in Wiki?
I found such a list in a VB 6 book.
Лазар 4,0 32 bit (sometimes 64 bit); FPC3,2,2

Leledumbo

  • Hero Member
  • *****
  • Posts: 8799
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #35 on: February 20, 2015, 07:40:53 am »
I cannot find a list of prefix conventions used in Lazarus (comboboxes are named cboSomething, labels are named lblSomething, etc.).
I have no idea how it is used in Delhi and Lazarus? Is it worth to create such a page in Wiki?
I found such a list in a VB 6 book.
Lazarus doesn't seem to have one, but perhaps Delphi one can be followed:

flywire

  • Jr. Member
  • **
  • Posts: 85
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #36 on: February 20, 2015, 09:06:42 am »
... basic ... with ... lines numbers, goto, gosub, and all these disorganized craps (some think they are advantageous as long as they can't know another language deeply) ...

Hey dinosaur, have you heard that someone invented a wheel? This is very very old basic and in many ways basic is similar to pascal (except pascal has no M$). :D

flywire

  • Jr. Member
  • **
  • Posts: 85
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #37 on: February 20, 2015, 09:14:08 am »
Lazarus doesn't seem to have [a code standard], but perhaps Delphi one can be followed:
Very good idea. Can we adopt it?[/list]

howardpc

  • Hero Member
  • *****
  • Posts: 4144
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #38 on: February 20, 2015, 09:39:19 am »
The trouble with all such conventions is that they are unenforceable. So some people abide by them, many do not, and a very mixed bag of namings (or lack of namings) continues to be perpetuated.

It's rather like car design. Whenever I drive an unfamiliar car I use the indicator to signal turning left, and find I have sounded the horn or turned the windscreen wipers on - because manufacturers see no advantage in international cooperation and standardisation (unless it becomes a statutory requirement).

I think if the Lazarus team had found a compelling reason to insist on such a naming convention in the LCL they would have introduced it long before now. They seem content with the minimal requirements (new types begin with T, American spelling rather than English where they differ etc. which is basically simply following Delphi).

sam707

  • Guest
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #39 on: February 20, 2015, 10:28:49 am »
@howardpc +1 = no need "naming conventions" then big minds (big boys) are responsible to invent their own, along their projectS and librarieS :) thats great!

Hey dinosaur, have you heard ....

@flywire

SO you made it = you just demonstrated TRUE basic is dead (in the late 1980 years, i would say 1987-88) and new basic is a kind of FORKED pascal, a sad disorganised COPYCAT! and calling this crap "basic" sounds wrong to my ears

THEN prefer talk to God (Pascal) than any of his disorganized forked saint :D

about dinosaurs = without them you wont be there, and as you seem to not have any respect, you do not deserve mine in any way then.... hmmm and dont be jealous, you dont feed me, i dont pretend to feed you $$$$$$$ HAHAHAHAHA ;)
« Last Edit: February 20, 2015, 10:59:14 am by sam707 »

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #40 on: February 20, 2015, 11:13:17 am »
@howardpc +1 = no need "naming conventions" then big mind and big boys are responsible to invent his own, along his projectS and librarieS :) thats great!


Are you really as ignorant as your posts imply or is it some kind of troll game for you posting in this forums?
You do know that the naming conventions make a library easier to use right? I did not see any one talking about enforcing any conventions in yours or anyone else's code.

A question if the lcl team should use the delphi convention has nothing to do with anyone outside the lcl team even my comment has nothing to do with the decision to use it or not. If I get a vote then I vote yes, please use the delphi conventions if possible, that will make my life easier as I use both of them from time to time, just avoid any hungarian notation in the variable names just distinguishing between class private variables procedure local variables and global ones should be enough in my experience everything else makes things a bit harder to write. Finally thank you for any and all enhancements.
« Last Edit: February 20, 2015, 11:21:57 am by taazz »
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

sam707

  • Guest
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #41 on: February 20, 2015, 11:23:26 am »
@taazz YES I am an ignorant, my RL job is ballet dancer... actually looking for a new pink tutu :D trolliluni trollilunah :P

flywire

  • Jr. Member
  • **
  • Posts: 85
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #42 on: February 20, 2015, 01:20:55 pm »
... you seem to not have any respect ...

No offence intended from one old line basic programmer to another. Anyway, the line numbers were little more than an old way of calling procedures unless someone was a real spaghetti coder.

mercury

  • Full Member
  • ***
  • Posts: 154
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #43 on: February 21, 2015, 01:21:23 pm »
Should be easy to implement, why don't you do it? Extends code tools with this feature, you know what keypress triggers the correction. Identifier lookup functionality is provided already.
I am a newbie to Lazarus. I don't know how to do that. If I can modify the IDE, I have more desire to dock all windows in to one like vb or many other IDE(VS, CodeBlocks, DEV-CPP, FbEdit ...).

Leledumbo

  • Hero Member
  • *****
  • Posts: 8799
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: Pascal for VisualBasic users in the Lazarus wiki
« Reply #44 on: February 21, 2015, 04:45:28 pm »
I am a newbie to Lazarus. I don't know how to do that. If I can modify the IDE, I have more desire to dock all windows in to one like vb or many other IDE(VS, CodeBlocks, DEV-CPP, FbEdit ...).
I can see that since you don't even know how to do it despite the package is shipped by default and the wiki has an article about it. Attached is how I configure my Lazarus.

 

TinyPortal © 2005-2018