Welcome, Guest. Please login or register.

Author Topic: Learning C with the Amiga  (Read 32613 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #14 from previous page: February 09, 2007, 07:56:38 PM »
In that case, the USA is not a 1st world country.
Healthcare costs are quite a political debate around here. :(
 

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #15 on: February 09, 2007, 09:21:42 PM »
OT:
I am Portugues born, American raised.
I see this country with clear eyes.  It has many problems that foreigners don't see and I'm not a blind loyalist like many seem to be.

The problem with this government is that politicians also have business interests.  There should be a law separating the 2.  That is the root of many woes.  Everybody is in it for money and not for what is right.
 

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #16 on: February 12, 2007, 12:07:57 PM »
Quote

koaftder wrote:
c may be a pain for dealing with strings withouth a nice string lib but at least its not like vb.net on opening a file handle:

FILE * bla = fopen("c:\koft\pov.c","w");

vs

Dim bla As New System.IO.FileStream("c:\koft\POV.c", System.IO.FileAccess.Write)

(;


LOL, you make it sound like you typed every letter of that code.  The IDE's auto-complete and selection as soon as you hit the "." reduces the actually typing greatly.

Also, a simple:
imports System.IO

at the top of your code (similar to a #include) and all you'd need in the code is:

Dim bla as New StreamWriter("c:\koft\POV.c")
 

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #17 on: February 13, 2007, 01:31:11 PM »
Quote

Karlos wrote:
Quote

falemagn wrote:
@ Cymric

Why would a text parser need to concatenate strings?


My point exactly. All the parsing I've done, if anything usually involved breaking text up into smaller tokens, not concatenating them into larger ones.


So you've never built SQL statements on the fly based on parameters in a filtering selection screen for a program that generates a report?
 

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #18 on: February 13, 2007, 04:34:32 PM »
Ok, I've written code that parses a file and replaces one text/byte(s) code with another.  Now in VB6, you can read a 2MB file into a string, in memory, and doing a simple replace all at once and then writing over the old file was much faster than the traditional line by line method of drilling through the file, while writing to another followed by the delete of the old one and rename of the new to match the old.

It came in handy when converting large .CSV files with lines terminated with CR to CR/LF and vice versa.

File access is slow compared to memory access, hence having the entire file in memory was ideal and VB's "Replace" command allows you to use any sequence of bytes.  It's not just limited to 7 bit ascii.

This turned a batch processing job of many large files into one that went from taking over an hour to taking just several minutes.
 

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #19 on: February 13, 2007, 11:50:54 PM »
Quote

CannonFodder wrote:

Why use VB to do the job of PL/SQL(T-SQL etc)?

Anyway, isn't this thread supposed to be about learning C?  What point are you trying to achieve by spamming it with off topic crap about how superior VB is?

Start another thread and discuss it there.


Stop being ignorant, I was giving Karlos an example where string concacting becomes useful and saves time.
 

Offline Louis Dias

Re: Learning C with the Amiga
« Reply #20 on: February 22, 2007, 07:23:47 PM »
Quote

koaftder wrote:
Many years back, a girl invited me to come to her place with offerings of food to teach her in the ways of programming. We both worked for a medical supply store, she did data entry, I wrote the software she slaved with. We hit it off and after a while I discovered she had tourettes and months later I was dumped via email. Karlos beware...  :-D


Are you sure it wasn't the C causing her to mouth off?  When she finally got sick of it, she sent you an email...
:ponder:
.
.
.
.
.
:devildance: