--------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00005 Date: 05/06/97 From: FRANK WANG Time: 07:02pm \/To: SERGEI KOSTAREV (Read 1 times) Subj: Delphi/FoxPro compatibili Hello Sergei, On 05 May 97 19:18 Sergei Kostarev wrote to All... SK> Please respond those who had an experience in establishing shared SK> access of Delfi- and Foxpro-based applicaions to common database SK> files. SK> Delphi version is 1.0 The best solution is, use SuccessWare's Apollo 3.0, with it you can have concurrent access/update to the same foxpro files in Delphi and Foxpro, it is the best I have ever seen. you can d/l a fully functional copy from its web site, www.gosware.com. I tested the 16 bit eval version recently. Delphi 3.0 is said to contain native BDE driver for Foxpro. but I'm not sure if it allows concurrent access or not, my test with those old versions of Delphi's dBase 4 mdx support shows negative result. Rgds, -=Frank=- wang@cebu-online.com --- * wsOMR 1.20b * If you can't see the bright side, polish the dull side * Origin: IQ BBS - Cebu City, Philippines (6:754/10) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00006 Date: 05/06/97 From: FRANK WANG Time: 07:02pm \/To: STEVE BATSON (Read 1 times) Subj: Delphi 3 Arrived today! Hello Steve, On 05 May 97 16:56 Steve Batson wrote to All... SB> I just receivied my Delphi 3 package today (haven't installed it SB> yet), but am anxious to see how they did. I was on the Beta SB> program, but it's always fun to see what made it into the final How to be a beta tester? Rgds, -=Frank=- --- * wsOMR 1.20b * A dirty book is seldom dusty * Origin: IQ BBS - Cebu City, Philippines (6:754/10) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00007 Date: 05/04/97 From: SIMON HUGGINS Time: 09:35pm \/To: STEVEN READ (Read 1 times) Subj: Testmail Hi Steven, On Thursday, 1 May 1997 at 20:19:02, Steven Read confused me talking about: Testmail to Simon Huggins SH>> * Origin: How do *YOU* define normal? (2:440/7.15) SR> ^^^^^^^^^^^^^^^^^^^^^^^^^^^ SR> By not worrying about what's normal and programming. Ah, but what happens when you stop programming? Do you cease to exist? Are you a Delphi programmer if reply=YES then begin cheer; cheer_some_more; end else begin boo; boo_even_more; end; bfn, si. Fido : 2:440/7.15 or Internet : huggie@dial.pipex.com Web : http://dialspace.dial.pipex.com/huggie .!. Cats are smarter than dogs...8 cats won't pull a sled. --- Terminate 4.00/Pro * Origin: Delta: Hmmmm wonder what that could mean?!? (2:440/7.15) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00008 Date: 04/29/97 From: MARTIN MAAT Time: 10:17pm \/To: SIMON HUGGINS (Read 1 times) Subj: Owner draw listboxes Hallo Simon SH> I have managed to create code which deals with putting items wider SH> than the list box onto two lines but not yet managed to get this SH> working for more than that. i.e. to recognise how many then loop SH> through for each one. SH> I tried to set the height variable passed in OnmeasureItem and then SH> inspect it in OnDrawItem but it didn't work :( It does work, be carefull not to rely on the Items[Index].Object value though, you cannot get to it for some from within MeasureItem for some reason. Setting Height for an item however should work just fine. The maximum height is 255 pixels. What is your problem exactly? SH> Is there any good reason why OnDrawItem can't be empty? Well, you do want something to be drawn, right? The beauty of OwnerDraw mode is that nothing will be drawn unless you want it to. SH> Is there a much more elegant solution (there must be somewhere) This is as elegant as it gets. Did you set the draw mode to OwnerDrawVariable? You need to do this in order to be able to set the height of individual items. Groeten, Martin. --- FMail/386 1.02 * Origin: -=[ E-mail: m_maat@knoware.nl .......... ]=- (2:286/420.1) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00009 Date: 05/03/97 From: BRYAN SMITH Time: 02:00pm \/To: ALL (Read 1 times) Subj: An interesting Object Pascal "gotcha" The following code crashed Delphi 1 with an "Integer Overflow" message. var j,k : integer ; for j := 1 to 20 do begin k := Random(1000) - 500 ; end ; The on-line documentation does not say what is the return type of Random when it has an argument. It must be of type word, causing the right hand side to be evaluated as a word variable. This word goes negative and causes the crash if Random(1000) is less than 500. On the other hand, k := -500 + Random(1000) ; works OK. Presumably by putting the -500 first, we have forced the right side to be evaluated as an integer rather than as a word. You can also force the expression to work by type-casting Random(1000) as an integer ... k := integer(Random(1000)) - 500 ; Can anyone explain why the message is INTEGER overflow, when it seems to be a WORD problem ? Anybody know of any similar problems with the language ? The only one I've run across is in expressions such as k := 80 * 1001 div 1101 ; Although the result is going to be an integer, the expression overflows. You have to say k := longint(80) * 1001 div 1101 ; to force evaluation in long arithmetic. --- PPoint 2.00 * Origin: Kingston, Canada (1:249/109.11) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00010 Date: 05/03/97 From: MARTIN MAAT Time: 09:10am \/To: BRYAN SMITH (Read 1 times) Subj: Need insight into object behaviour. Hallo Bryan BS> I recently had a (Delphi 1) problem - the program GPF'ed whenever BS> it exited. Debugging revealed that the problem lay in the area of a BS> FontDialog. The program had a TFont variable named BodyFont which BS> was created by the Form's FormCreate handler and freed by the BS> Form's FormDestroy handler. [...] BS> BodyFont.Assign(FontDialog.Font) ; BS> might be more appropriate. Happily, this fixed the problem. Sadly, BS> this use of an object's "Assign" method is very poorly documented. BS> Can anybody provide some insight into what is going on here ? You know too much and you know too little. That's where trouble starts :-). First, you acknowledge the difference between deep and undeep copies of objects. That's good. Using the assignment operator := creates an undeep copy. In Font2 := Font1 Font2 (a 4-byte pointer) gets the same value as Font1, meaning it will now point to the same instance of the font object Font1 points to. This one font object can now be referenced through both font1 and font2 variables. This will hardly ever be usefull but in having objects as actual parameter. There will be no harm done though, unless there already was an instance Font2 (due to a previous Font2 := TFont.Create ), in which case Font2 would be orphaned. The old Font2 would then occupy memory and you would not be able to free it anymore since nowone knows where the instance is located. The assign _method_ always creates a deep copy. Not the object pointer is copied, but all of the object's data is copied over the other object's data. For this to be possible, there must be two different instances of the object before you use this method. If Font2 was not created before you do Font2.Assign(Font1); you are likely to get some sort of system error because Font2 does not point to a valid TFont object. Instead, it will be nil or point to some random location in memory. That location will most likely not be granted to your application to have it's way with, and if it would be by chance, you would overwrite some of your own code or data which would be trouble just the same. So much you seemed to understand. So, what really happened was that your BodyFont was really the same instance as the font dialog's font property. This could still be fine, BUT YOU MUST NOT DESTROY THAT INSTANCE! When your program terminates, all objects are destroyed, meaning all Destroy methods of all objects are called. The font dialog will clean up it's internals, including it's font property. By the time it calls the Destroy or Free method of that font property, there will no font property anymore because YOU destroyed it earlier! ===> GPF A similar problem arises when we want to "clean up" components we created. A component's Create method takes one parameter, being the owner of the created component. Being the neat nerts that we are, we tend to clean up everything we created. However, every component tries to clean up everything it owns when it is destroyed. ===> GPF When you provide an existing component as the owner parameter on the creation of a component, you must leave the inititive to destroy the component to it's owner. BS> "Under Win32, GDI objects are not shared as are their 16-bit BS> counterparts. GDI objects are stored in the process's address BS> space instead of a globally accessible memory block". Is this BS> relevant to the problem, and to whether it is also a problem in BS> Delphi 2 ? This does not seem to be an issue in this case. Groeten, Martin. --- FMail/386 1.02 * Origin: -=[ E-mail: m_maat@knoware.nl .......... ]=- (2:286/420.1) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5B00011 Date: 05/06/97 From: OLEG FYODOROV Time: 08:50pm \/To: SEBASTIANO MAUGERI (Read 1 times) Subj: SLQ and Delphi Hello Sebastiano! SM> I must find a string contained on a field on a database. What is the right SM> instruction SQL? SM> Can you help me? :) 1. Exact string: ...where MyField='MyString' 2. Starts with string: ...where MyField like 'MyString%' 3. Contains string: ...where MyField like '%MyString%' 4. Finishes by string: ...where MyField like '%MyString' Two first cases faster than 3 and 4. Bye, Oleg. oleg@ekohelp.msk.ru --- * Origin: <<< Gummi Bears Workstation >>> (2:5020/509.30) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5C00000 Date: 05/06/97 From: BERT PERLITZ Time: 07:25am \/To: *.* (Read 1 times) Subj: recordcount-problem hi, dolphins, yesterday i got a strange problem. i have a paradox-table which i have indexed for a field date and a field time. now i want to extract all data that concerns day x (lets say 10.03.1997 for example). so i create a query in delphi 1 to get the datas. it lloks like with qry_data do begin close; sql.clear; sql.add(format('select * from %s',[datadir]); sql.add(format('where date = '''%s''',[datafile]); sql.add('order by time'); open; end; i splittet up the sql because the sourcecode is more readable. this works fine, but i get a dataset which i can't change because it is readonly. this is caused by the 'order by time' expression. ok, i thought, time is indexed so the data should be in the right order even if i don't order it explicitly, and i deleted the order-by-expression. and strange things happened. in a subroutine i go through the datas of the sql (with first and next) from 0 to qry_data.recordcount. and when i don't use the order-by-expression the recordcount is always the number of all records in the complete table. can anyone explain me why this happens? i tried several things out and found that the data i get back is exactly the same that i get with the order-by. but the recordcount is set to the maximum number and i can't find the reason. don't try to understand all... bert the ;-} --- Terminate 4.00/Pro * Origin: it's so hot you could lay an egg on the sidewalk (2:2480/60.10) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5C00001 Date: 05/06/97 From: ALEXANDER ZAVALISHIN Time: 10:59pm \/To: SEBASTIANO MAUGERI (Read 1 times) Subj: SLQ and Delphi Hello Sebastiano. c 04 1997 11:53, Sebastiano Maugeri wrote to ALL: SM> I must find a string contained on a field on a database. What is the SM> right instruction SQL? Can you help me? :) Do yo mean that you have to locate a record (or records) by a given field value? Use this simple sql construction: select * from ^^^ this means that you want all fields to be included in the nswer if you need some certain field values write select tablename.Field1, tablename.Field2 etc where . = for instance: select * from drinks where drinks.proof = 80 Alexander --- * Origin: 쥬, , 㦪? (2:5020/630.37) --------------- FIDO MESSAGE AREA==> TOPIC: 269 DELPHI Ref: E5C00002 Date: 05/06/97 From: LEE LEFLER Time: 09:35am \/To: SEBASTIANO MAUGERI (Read 1 times) Subj: SLQ and Delphi > I must find a string contained on a field on a database. What is the > right instruction SQL? Select fieldname from tablename where tablename like '%substring%' For instance Select distinct(tname) from syscolumns where creator like 'll%' This would return all the table names that I have created (all tables that have a creator that starts with ll). Distinct means that it only lists each table once. -ll * Origin: infinity@sprintmail.com (1:280/5)