On Thursday 21 May 2009, KhurramM wrote:
> 
> Well I again search the same site to find gambas2.12 for my hardy. Thanks a
> lot. Still need to try it, yet.
> 
> I experimented the file on my testing jaunty:
> (see attachment)
> 
> To gambas forum: I installed gambas via on jaunty (just for trial). It used
> 37.5mb total including this gambas file to install the package.
> Gambas can be packaged into a plus/minus a little 37.5mb binary installer.
> :jumping:
> 
> The person who told me it will take a CDs data to make an installer, seems
> to quiet wrong, in his assertion. :-)
> 
> Best Regards

I asume you are fresh from a windows C environment jumped into the linux world.


You need to read that message carefully again. Rob is almost right with his 
statement.

First you need to know in the windows world the differences between W98, XP and 
Vista.
when you write a program for one of those versions it does not work out the box 
in one
of the other 3. uuuuhmmm yes I know it can work sometimes but there is no 
garanty.
I wrote a programm with the WMP SDK71 on W98 and that does not work on the 
others.
Simple because MS changed something in the background for XP, Vista not tried.
This was using a binary package installer as you prefer.
The source can also be compiled for XP and Vista. I do have 3 packages and 3 
times
the size to use for the simple 1 file installer for the same program.

If we do the same for "linux" programs you must understand there are over 100 
different
distributions, name them w98,w98se,me,xp,vista,2000,nt.
Yes some are constructed from a master like Debian is used for the ubuntu 
series.
Mandriva for i.e. PCLinux2007, RedHat for fedora, Centos, etc. In MS Window 
terms the
Home, Premium, Ultimate etc.

Let say we support ten of those master systems, we need ten times the size of 
our full
program. Your mentioned 35MB was for ONE distribution, so we need 350MB now, 
half a CD.
(the source is less then 20MB ATM usable for all ten systems and children of 
them) 

Now comes the support to get a working system. We need the 4 most used Database 
engines.
Some PDF, XML and network support as i.e. Curl.
Everey one of the 10 master distributions compiles these on there likes for 
ordering 
in the disk map, the configuration and possible options.
Just a number but let say for a system you need 50MB to support this in 
compiled form. 
Now the 10 master distributions need 10 times 50MB as 500MB (almost a full CD)
(the source is less then 50MB and usable for all ten systems and children of 
them)

These support may already be installed by the distribution or are available for
installation as binary packages, and full supported for bug fixes by them.

If the guy that makes a program like gambas should do the way you want he must
deliver a file with a size for all code:
35MB gambas compiled x  10 = 350MB
50MB support compiled x 10 = 500MB
some setup program and total 850MB at least.
Give HIS support on the supporting code DB,PDF,XML and network stuff.

Noway he will or can do this. Do you release your program with this as 
requirement?
He wil never have enough time to live anymore or to make his application 
(gambas).

Second: this file will be picked up by major sites as Download.com and 
snapfiles and
many insecure sites( for dismanteling and add malware/virus and repacked) for 
the
simple windows to linux jumpers that doeds want the "easy way without thinking".

Third: When I want to jump to an other linux distribution it is simple a few 
commands
to make a working version again. For my WMP application, having the source you 
can
change the function name changed between W98 and XP and recompile to get it 
working again.

Binary delivery is only usefull if it is done for a specific distribution by 
that 
distribution or the programmer head/leader. 
This is a safe place to get the program and for new people starting with linux 
the distributions repository is the onle safe place anyway.

For programmers it should not be a problem to compile a fresh new release of
the developer program used for creating there own programs, they need to compile
there own programs to. (not every program language has a IDE to do it)

Do not see the figures and conditions as absolute but as indication what is
involved in the total process to do a job as you prefer (or did after read 
this).
It shows why source delivery and prefers this way in the linux world.


I do also follow your thread about the C/C++ based character input.

You can be a good programmer for applications now in C/C++ but do not 
understand 
the working and background of C/C++, only your programs.

Porting a C program source to Basic source is not simple copy/past the code and
in the editor using the replace function to change the C statements text to 
Basic
words. You need to understand what the specific C statement does and find the 
Basic statement to do the same thing. The grammar/syntax between both languages 
are also different.



> PUBLIC SUB Main()
>
>   ' Declare AND initialize variables.
>   DIM count AS Integer
>   ' The values are initialized at Zero, by above command

Wrong. In C,  int Count;
The value is not set to zero here in Basic (for gambas).
The name is specified and a memory location is reserved for
storage of the value with the name 'count'
If you ask in VB it will tell you the value is 'Nothing' or 'Null'
In C/C++ it works the same, it declares a name and memory location.
For gambas it does or should do the same, but if you do
  count = count +1 
and may by the variable handler seen the value is not set (Null) and 
preset to 0 (zero) for the expresion evaluator and result is then 1.
In PHP program language it also say Null and the increment results to 1. 

>   
>   DIM c AS String
> 
>   ' READ , PRINT , AND count characters.
>   PRINT "Enter characters (Ctrl+D to quit): "
>   LINE INPUT c
>   PRINT c

The (LINE) INPUT (and PRINT) are line oriented text statements.
the getchar in C is a character based statement, it wait for key press and 
returns
The INPUT waits for the CR charactercode 13 dec. or 0D hex. and returns the 
buffer
filled with pressed keys.

For the print you will see the line behaviour by the way the single letters are 
every time on a new line.

>   count += Len(c)

You asume here len(c) = 0 or 1. Wrong it is 0, 1, 2 or even more.
C is variable type of string and that can hold 0 to 10000 characters.
The type of Byte or Char should be the more correct one.

>   WHILE NOT Eof      ' This doesnt works

No wonder. Eof what?
As mentioned in a previous post the Eof function belongs to the stream object.

Gambas Wiki says:http://gambasdoc.org/help/lang/eof?view
  Result = Eof ( [ Stream AS Stream ] ) AS Boolean'
  Returns TRUE if we are at the end of the stream. 
  If Stream is not specified, then the standard input is used
so While Eof() should be the correct line.
  See LINE INPUT for an example:http://gambasdoc.org/help/lang/lineinput?view

>      'PRINT c1
>      LINE INPUT c
>      count += Len(c)
>      PRINT c
>   WEND 

Why len(c), You want/are working with single character input. 
Just 'INC count' or 'count += 1' is enough. :)

>
>   ' PRINT the number OF characters printed.
>   PRINT count & " characters printed."
>   
>END

Stream & Input/Output functions:http://gambasdoc.org/help/cat/stream?view
  READ:http://gambasdoc.org/help/lang/read?view 
  READ [ # Stream , ] Variable [ , Length ]
  LINE INPUT c should be READ c,1 or READ c

  WRITE:http://gambasdoc.org/help/lang/write?view
  WRITE [ # Stream , ] Expression [ , Length ]
  PRINT c should be WRITE c,1 or WRITE c

These two are the best to simulate the char i/o in C/C++

Try next


PUBLIC SUB Main()

  ' Declare AND initialize variables.
  DIM c, count AS Integer
   
  DIM cha AS String
 
  ' READ , PRINT , AND count characters.
  PRINT "Enter characters (or Press Carriage Return to quit): "
  READ cha,1

  WHILE (cha <> KEY.Return)
    WRITE cha,1
    count += 1
    READ cha 'get next character
  WEND 

  WRITE cha
 
 ' PRINT the number OF characters printed.
  PRINT count & " characters printed."
   
END


Best regards,

Ron_1st

-- 

------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, & 
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com 
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to