TweetFollow Us on Twitter

Nov 90 Mousehole
Volume Number:6
Issue Number:11
Column Tag:Mousehole Report

Linking THINK Pascal

By Larry Nedry, Mousehole BBS

From: Jaylieske

Re: Think Pascal and Language Systems Fortran

Just got the September MacTutor and noticed the question by ‘Atom’ on page 94 concerning Fortran and Think Pascal. I’ve recently been delving into that and could offer the following comments.

Using Language Systems Fortran 2.1 it’s pretty hard to call routines developed with Think Pascal 3.x, but it is possible. I’ve developed some file utilities using Think Pascal and wanted to call them from LS Fortran.

The utilities provide the current time, the creation date, modification date and full path name (truncated on the left so one gets the really “significant” portion of the path) for any file connected to a Fortran unit.

I developed and debugged the routines in Think Pascal and love it. Unfortunately, it proved very difficult to link that to Language Systems Fortran because of the manner in which Think produces its ‘OBJ ‘-compatible libraries. So I ended up porting the Think Pascal to MPW Pascal and then linking it with a Fortran main program and subroutines. By the way, I didn’t have to use the MPW ‘PasLib.o’ library, so people who don’t own MPW Pascal can actually use and link the object code with no difficulty.

Anyway, the problem with Think libraries is as follows--and I’ve confirmed some of this with Rich Siegel at Think. As Rich also mentioned on page 94 of the September MacTutor article, Think Pascal does produce ‘OBJ ‘-compatible files. MPW owners can do a ‘dumpobj -mods’ of the Think libraries quite readily, for example. If you do this, then you’ll see both the problem and perhaps also the reason why Think Pascal libraries ultimately ought to be quite readily usable with MPW languages such as Language Systems Fortran.

However, if you do a ‘dumpobj -mods’ of either MPW Pascal or Language Systems Fortran for the Interfacelib.o or Fortranlib.o files, you’ll find that the ENTRY points in the ‘OBJ ‘ files are all in caps, since Pascal is case insensitive. In fact, the MPW linker is case sensitive (in order to deal with the C people) and so the MPW Pascal compiler puts out all entry names in capital letters in the ‘OBJ ‘ files. Same goes for Language Systems Fortran. Hence, they’re quite sympatico.

On the other hand, Think Pascal’s compiler produces case-sensitive entries in the ‘OBJ ‘ files. For example, the Pascal function ‘CognitoErgoSum’ would have an entry in the ‘OBJ ‘ file as COGNITOERGOSUM but in Think’s Pascal it would be ‘CognitoErgoSum’. The linker treats these as being different. It’s therefore probably a ‘blessing’ in that the Think runtime and Pascal libraries (which are upper/lower case) are therefore “different” from the comparable MPW libraries. It might be a waste since MPW’s NEWPOINTER probably is exactly the same as Think’s NewPointer, but at least one has the possibility of being able to deal with two different Pascal dialects.

The bad news occurs for the user. Any unit created with Think Pascal will use the capitalization as it occurs. So a routine such as UpperAndLower will have an entry in Think’s ‘OBJ ‘ file as ‘UpperAndLower’. Hence, if you want to have Think procedures and functions to be callable from languages such as Language Systems Fortran (or even from MPW Pascal), then you MUST use ALL CAPITAL LETTERS for every Think Pascal public procedure and function (i.e. all funcs and procs that appear in the interface portion of the unit). That makes for a very ‘unreadable’ Pascal program, although us old-time Fortran programmers will recognize the unreadability as ‘typical.’

Using the above guidelines, I have successfully linked a Think Pascal unit to a Fortran program and subroutines. And it’s not just a simple ‘show-me-you-can-do-it’ type of program. It’s a useful file utility that gives the above-mentioned information.

I hope that Think provides an UpperCase flag for entry points in their ‘OBJ ‘ files. Only heavily involved programmers would notice the difference. It probably would also be good for Think to maintain their case-does-matter entries so that they can keep their entry names separate from MPW’s.

The code I’ve been mentioning (mostly written in Pascal with some in Fortran) has been posted to Stanford’s ‘info-mac’ board which is widely used by institutional types like me that have access to ftp.

From: Wolfhound

Re: Font Size in PopUp Menus

Can someone tell me, how can I set the font size in a PopUp Menu without writing my own MDEF? I tried changing SysFontSize, but this doesn’t seem to work. Thanks.

From: Btoback

Re: Greying out popup menus

It simply writes over the item with a gray pattern and patBic mode. For a pop-up menu CDEF, see the April 1989 issue of MacTutor - there’s a whole article (and code, of course) for a pop-up menu control that can be disabled and gets grayed out properly.

From: Kasper

Re: PopUpMenuSelect

Does anyone know how to get PopUpMenuSelect to run reliably on the various Macintosh machines? I got it to run on my SE, but it won’t work on my SE30. Calling CalcMenuSize afterward doesn’t help. The system hangs after exiting the function, giving a bus error.

From: Reneb

Re: CDEF resource

Can anybody tell me where I can find the source code (in C or any other language) for an example control resource (CDEF)? I am using ThinkC, and I really like to write my own CDEFs, but none of the books or bulletin boards, nor ‘Inside Macintosh’ give enough practical information to handle this challenge. Thanks.

From: Mward

Re: CDEF resource

If you would like A CDEF in assembly I could probably dig up an example. If you find an example in C or Pascal, be sure and let us know. I’ve been looking for such a thing for awhile. (One of these days I’ll get tired of waiting and just do it myself). Also, AppMAker allows you do define some kinds of controls, and creates the resources for same.

From: Sysop

Re: CDEF resource

There are currently 2 CDEF examples in the Language File Library. From the Language File Library menu type ‘D CDEF’ for a list of files with CDEF as a key word.

P.S. The file names are ‘DEFAULT.’ which Draws default button outlines and ‘SLIDCDEF.SIT’ which includes sources for SuperSlide controls.

From: Reneb

Re: CDEF resource

I found a CDEF written in C in the ‘Language and Source Code’ lib of this BBS. The filename is SLIDCDEF.SIT by Chris Marchall. Although it is a relatively large file, the code is nicely structured and documented. I am currently trying to understand the structure in order to write my own.

From: Inbox

Re: TCL question

In the Starter project (of THINK C v4.0), why does an Untitled window come up automatically? I can’t find the code that creates that window. The only thing I can think of is that the program may think that it’s been invoked by double-clicking a document, and then the Preload() method would kick in.

So, please shed some light on this confusing matter. Also, what advice would you give as to the fastest and most painless way to learn to use TCL?

From: Inbox

Re: TCL questions

Does anyone know what proc sends the main pane of a document the draw() message whenever it’s first displayed? I can’t find the bloody thing...

Menus..

I’ve appended the command #s using ResEdit, and they work fine when I use things like gBartender->EnableCmd(myCmdID), but the DoCommand() method fails to recognize these IDs and I have to look at HiWord and LoWord stuff. Why, then, doesn’t DoCommand() recognize a command by that ID?

From: Jcb

Re: Object Pascal RadioButtons

I have a relatively simple problem but still confusing to a new user of Think Pascal OOP. I have successfully set up the Resources for Radio buttons, gone through the New(...), .IRadioButton, new(...), new(...), .IRadioGroup, AddButton, sequence and got the buttons to display in the window. My problem is how to get the control tracking to permit selection of the button. There are some references to doing mouse tracking, etc for the specific pane, but I wonder if I have been overlooking a relatively simple step. Any suggestions???

From: Inbox

Re: List Class

This is weird, but I don’t think there’s a List class in TCL. Am I going blind or what?

From: Stubob

Re: List Class

There is indeed a List class in TCL -- it’s called “CList” (!) and is in the Core Classes folder of your THINK C package and is described fully in the THINK C 4.0 manual - p.321. I also happen to have a PD “CLinkedList” class. If you’d like a copy of it, e-mail me and I’ll upload it...but check to see if it isn’t already online first.

And as a reply to your other message (re: learning TCL) the most effective (not easiest or fastest maybe...) way to learn TCL is to trace through one or two of the example programs, line by line and class by class, making sure you understand each line along the way. Slow, but thorough. Then start customizing the starter apps until you feel more confident - maybe add an about box, or make the window a color window, etc.

Hope some of that helped. (And if you find any good books, let me know!)

From: Noisy

Re: List Class

If you check out the Prepare() demo issue in the MouseHole libraries, you’ll see that it offers a bunch of TCL classes in exchange for $$$. I purchased issues #1 and #2, and they are superb! Over 2+ megs of source code, and a ListMgr based class among them -- unfortunately this stuff isn’t shareware, so I can’t upload it...Sorry.

From: Corner

Re: Scrolling Lists as a Class

Has anyone implemented scrolling lists (like with LNEW) as a class? Where would you put them in the inheritance chain...below CPane? If anyone can offer any suggestions, it would be greatly appreciated. I am trying to write a LSC 4.0.1 application with a list in a window type 8 and have a list in that window.

From: Inbox

Re: List Class

Thanks for your help but, I was looking for a different type of list. Namely, a critter that’s created with the List Manager. And this, I guess, is just a list list of objects.

From: Mikev

Re: database

I’ve been developing with db_Vista and db_Query on the Mac for close to six months and I don’t recommend these products. Both are good when they work, but I have encountered too many bugs to recommend them for a commercial product, especially in db_Query. The idea is good, db_Vista is fairly easy to figure out, db_Query the documentation sinks. I have objects, source, and extended support. The source is just about worthless: it is largely uncommented, undocumented, and unstructured. It is basically a Unix port and very un-Mac like. Although I have not been “officially” notified, I have been told the products are to be discontinued and no longer supported. Whether the product is picked up and supported by a new party is unclear. [db_Vista will be picked up and supported.-ed]

Their support staff has been very responsive, but not necessarily helpful. I’ve given them more bug fixes than they have given me. As far giving up on the Mac product (in favor of their PC business), I think it shows a lack of commitment to their customers. I would be happy if it worked, but it doesn’t. I was told they haven’t been shipping their multi-user network version, because of the bugs.

Does any one work with Inside Out, C-Tree file handler, Informix, Oracle? Or can recommend any database software?

From: Noisy

Re: database

I did some work with InsideOut, and it was quite impressive: the interface is *very* Mac-like, and well thought out. There is a suite of ‘Design Utilities’ to create your DataDictionary and files, as well as a set of RSRC files to embed in your Application. My only gripe with InsideOut was that it was almost overkill -- we wanted functionality barely beyond ISAM! While the ‘user views’, ‘multi-user sharing/locking’ and extremely sophisticated debugger were appreciated, the overhead needed for the final application was not. The resources alone added over 150K to the application! We ended up rolling our own, just to save space & time!

From: Inbox

Re: CtoPstr

Does this function alter whatever is passed to it? I think it may be killing my strings because they get run through it more than once...

From: Jweisner

Re: CtoPstr

CtoPstr reads the first length byte and appends a ‘\0’ character to make a C string. Multiple passes would truncate your string.

From: Jax

Re: ResEdit

I heard ResEdit2.0b2 is out there somewhere, so has anyone seen it??

Supposed to be more icon based.

From: Noisy

Re: ResEdit v2.0b2

OK Guys: I just spent $$??!! to download ResEdit v2.0b2 from CompuServe, and was mildly disappointed...the interface is a little cleaner, and it will *finally* handle color-related resources (cicn’s et. al.) but it’s still too early to rush out and take up 500KB+ of disk space for the new version. My biggest complaint is that any MENU editing fails miserably on my MacII - bus error - do not pass go, etc.

On my Mac+ at home it’s does it’s thing, but gee whizz...I’ve got 43,000 other shareware tools to do the same thing anyway. I’d give ResEdit v2.0 a few more months to mature -- we will use no utility before it’s time.

From: Dash

Re: ResEdit v2.0b2

I’ve been using ResEdit 2.0b2 for some time, and MENU resources work fine on my Macintosh II, IIci, and IIfx... Maybe you version is somehow corrupted.

From: Noisy

Re: ResEdit v2.0b2

I’m using a Spectrum SuperMac 19" monitor & system 6.0.3 -- I suspect that the problem may lie there. I’m still working on it though.

Thanks for your comments!

From: Jax

Re: Mac Plus Accelerator

Now that it is September almost, MacUser recommends the Gemini030 accelerator for the Mac Plus, but the 25mhz version, along with the SCSI kit. Never heard any complaints about them...

From: Rcolvin

Re: Hypercard networking

I got an interesting situation here. I need to be able to access AppleTalk from hypercard, in order to write a stack that performs the same functions as the “BroadCast” rdev. I have the “HyperAppleTalk” stuff that Don Koscheka wrote, but they don’t work the way the docs say they should.

In fact, some don’t work at all. Has someone else solved this problem, or is there a later version of the HyperAppleTalk XCMD’s and XFCN’s??

From: Wildman

Re: EtherNet to Vaxen

What experiences do people have with EtherNet connections between Macs and VAX computers? I’ve worked with folks who use a GatorBox as a gateway between EtherNet networks and AppleTalk networks. It works fine for stuff like terminal connections but the filesharing is pretty slow because of AppleTalk’s limited bandwidth. What I think I want is an EtherNet card for my MacII. What cards work best? What software packages exist for good performance file sharing? Is there a DECnet package currently available?

From: Arlen

Re: EtherNet to Vaxen

I’m using a 3Comm Etherlink NB with a IIcx and have experienced no problems. I’m also using TSSnet from Alisa, and cannot say the same. Skip the TSSnet and wait for LANWorks Macintosh (should be available from DEC in about 2-3 months. I’ve no experience with it, but it’s bound to be better than TSSnet.

My grouches with TSSnet start at it refusing to follow the Mac interface, proceed on through its non-standard init behavior, and end at its inability to transfer some kinds of files through the network without substantially altering them. All in all, a lemon.

From: Teisen

Re: Fastback II Fails to Restore

I just received MacTools Deluxe and will take a look at its backup program. I seem to remember trying to use its earlier incarnation and being very disappointed. I think that, if it encountered a disk error, it would ask for all previous disks be reinserted before asking for the replacement disk. What a waste...

From: Mward

Re: Fastback II Fails to Restore

I also have MacTools Deluxe, and am very disappointed in the product in general, and in the backup feature in particular. I recently took a look at the file this program uses to keep track of deleted files, and it had a list of about fifty files, exactly one of which was undeletable. Fat lot of good that’s going to do anyone.

I’m tempted to try out the upgrade to Fastback, but I’m getting really sick of paying high prices for minor fixes, cosmetic changes or for graduating from beta quality to almost production quality software.

Makes me think back to the good old days of piracy (just kidding, guys - really, honest).

 
AAPL
$102.47
Apple Inc.
+2.71
MSFT
$44.88
Microsoft Corpora
+0.80
GOOG
$526.54
Google Inc.
+5.70

MacTech Search:
Community Search:

Software Updates via MacUpdate

RapidWeaver 6.0 - Create template-based...
RapidWeaver is a next-generation Web design application to help you easily create professional-looking Web sites in minutes. No knowledge of complex code is required, RapidWeaver will take care of... Read more
NTFS 12.0.39 - Provides full read and wr...
Paragon NTFS breaks down the barriers between Windows and OS X. Paragon NTFS effectively solves the communication problems between the Mac system and NTFS, providing full read and write access to... Read more
RestoreMeNot 2.0.3 - Disable window rest...
RestoreMeNot provides a simple way to disable the window restoration for individual applications so that you can fine-tune this behavior to suit your needs. Please note that RestoreMeNot is designed... Read more
Macgo Blu-ray Player 2.10.9.1750 - Blu-r...
Macgo Mac Blu-ray Player can bring you the most unforgettable Blu-ray experience on your Mac. Overview Macgo Mac Blu-ray Player can satisfy just about every need you could possibly have in a Blu-ray... Read more
Apple iOS 8.1 - The latest version of Ap...
The latest version of iOS can be downloaded through iTunes. Apple iOS 8 comes with big updates to apps you use every day, like Messages and Photos. A whole new way to share content with your family.... Read more
TechTool Pro 7.0.5 - Hard drive and syst...
TechTool Pro is now 7, and this is the most advanced version of the acclaimed Macintosh troubleshooting utility created in its 20-year history. Micromat has redeveloped TechTool Pro 7 to be fully 64... Read more
PDFKey Pro 4.0.2 - Edit and print passwo...
PDFKey Pro can unlock PDF documents protected for printing and copying when you've forgotten your password. It can now also protect your PDF files with a password to prevent unauthorized access and/... Read more
Yasu 2.9.1 - System maintenance app; per...
Yasu was originally created with System Administrators who service large groups of workstations in mind, Yasu (Yet Another System Utility) was made to do a specific group of maintenance tasks... Read more
Hazel 3.3 - Create rules for organizing...
Hazel is your personal housekeeper, organizing and cleaning folders based on rules you define. Hazel can also manage your trash and uninstall your applications. Organize your files using a... Read more
Autopano Giga 3.7 - Stitch multiple imag...
Autopano Giga allows you to stitch 2, 20, or 2,000 images. Version 3.0 integrates impressive new features that will definitely make you adopt Autopano Pro or Autopano Giga: Choose between 9... Read more

Latest Forum Discussions

See All

Swap Heroes (Games)
Swap Heroes 1.0 Device: iOS Universal Category: Games Price: $.99, Version: 1.0 (iTunes) Description: **Half price for a limited time only** Swap Heroes is a casual turn-based strategy adventure. Form a group of heroes and guide them... | Read more »
Ghost Blade (Games)
Ghost Blade 1.1 Device: iOS Universal Category: Games Price: $4.99, Version: 1.1 (iTunes) Description: Get the most outstanding 3D Action Game from App Store NOW! For those who dare pursue dreams. Masterpiece of Yu Shi Game ---China... | Read more »
Fiete – A Day on a Farm Review
Fiete – A Day on a Farm Review By Amy Solomon on October 21st, 2014 Our Rating: :: A MEMORABLE EXPERIENCEUniversal App - Designed for iPhone and iPad Fiete – A day on a farm in an interactive app for young children full of... | Read more »
Tilt to Live: Gauntlet’s Revenge is Almo...
Tilt to Live: Gauntlet’s Revenge is Almost Here Posted by Jessica Fisher on October 21st, 2014 [ permalink ] One Man Left has announced the official release date of Tilt to Live: Gauntlet’s Re | Read more »
Sago Mini Monsters Celebrates Halloween...
Sago Mini Monsters Celebrates Halloween with Fun Costumes and Special Treats. Posted by Jessica Fisher on October 21st, 2014 [ permal | Read more »
Inferno 2 Review
Inferno 2 Review By Andrew Fisher on October 21st, 2014 Our Rating: :: TWIN STICK GOODNESSUniversal App - Designed for iPhone and iPad With tight controls and awesome, stark visuals, Inferno 2 is loads of fun.   | Read more »
Clips Review
Clips Review By Jennifer Allen on October 21st, 2014 Our Rating: :: CONVENIENT PASTINGUniversal App - Designed for iPhone and iPad Making copying and pasting more powerful than usual, Clips is a great way to move stuff around.   | Read more »
MonSense Review
MonSense Review By Jennifer Allen on October 21st, 2014 Our Rating: :: ORGANIZED FINANCESiPhone App - Designed for the iPhone, compatible with the iPad Organize your finances with the quick and easy to use, MonSense.   | Read more »
This Week at 148Apps: October 13-17, 201...
Expert App Reviewers   So little time and so very many apps. What’s a poor iPhone/iPad lover to do? Fortunately, 148Apps is here to give you the rundown on the latest and greatest releases. And we even have a tremendous back catalog of reviews; just... | Read more »
Angry Birds Transformers Review
Angry Birds Transformers Review By Jennifer Allen on October 20th, 2014 Our Rating: :: TRANSFORMED BIRDSUniversal App - Designed for iPhone and iPad Transformed in a way you wouldn’t expect, Angry Birds Transformers is a quite... | Read more »

Price Scanner via MacPrices.net

Select MacBook Airs $100 off MSRP, free shipp...
B&H Photo has 2014 a couple of MacBook Airs on sale for $100 off MSRP. Shipping is free, and B&H charges NY sales tax only. They also include free copies of Parallels Desktop and LoJack for... Read more
13-inch 2.5GHz MacBook Pro on sale for $100 o...
B&H Photo has the 13″ 2.5GHz MacBook Pro on sale for $999.99 including free shipping plus NY sales tax only. Their price is $100 off MSRP. Read more
Strong iPhone, Mac And App Store Sales Drive...
Apple on Monday announced financial results for its fiscal 2014 fourth quarter ended September 27, 2014. The Company posted quarterly revenue of $42.1 billion and quarterly net profit of $8.5 billion... Read more
Apple Posts How-To For OS X Recovery
OS X 10.7 Lion and later include OS X Recovery. This feature includes all of the tools you need to reinstall OS X, repair your disk, and even restore from a Time Machine backup. OS X Recovery... Read more
Mac OS X Versions (Builds) Supported By Vario...
Apple Support has posted a handy resource explaining which Mac OS X versions (builds) originally shipped with or are available for your computer via retail discs, downloads, or Software Update. Apple... Read more
Deals on 2011 13-inch MacBook Airs, from $649
Daily Steals has the Mid-2011 13″ 1.7GHz i5 MacBook Air (4GB/128GB) available for $699 with a 90 day warranty. The Mid-2011 13″ 1.7GHz i5 MacBook Air (4GB/128GB SSD) is available for $649 at Other... Read more
2013 15-inch 2.0GHz Retina MacBook Pro availa...
B&H Photo has leftover previous-generation 15″ 2.0GHz Retina MacBook Pros now available for $1599 including free shipping plus NY sales tax only. Their price is $400 off original MSRP. B&H... Read more
Updated iPad Prices
We’ve updated our iPad Air Price Tracker and our iPad mini Price Tracker with the latest information on prices and availability from Apple and other resellers, including the new iPad Air 2 and the... Read more
Apple Pay Available to Millions of Visa Cardh...
Visa Inc. brings secure, convenient payments to iPad Air 2 and iPad mini 3as well as iPhone 6 and 6 Plus. Starting October 20th, eligible Visa cardholders in the U.S. will be able to use Apple Pay,... Read more
Textkraft Pocket – the missing TextEdit for i...
infovole GmbH has announced the release and immediate availability of Textkraft Pocket 1.0, a professional text editor and note taking app for Apple’s iPhone. In March 2014 rumors were all about... Read more

Jobs Board

Senior Event Manager, *Apple* Retail Market...
…This senior level position is responsible for leading and imagining the Apple Retail Team's global event strategy. Delivering an overarching brand story; in-store, Read more
*Apple* Solutions Consultant (ASC) - Apple (...
**Job Summary** The ASC is an Apple employee who serves as an Apple brand ambassador and influencer in a Reseller's store. The ASC's role is to grow Apple Read more
Project Manager / Business Analyst, WW *Appl...
…a senior project manager / business analyst to work within our Worldwide Apple Fulfillment Operations and the Business Process Re-engineering team. This role will work Read more
*Apple* Retail - Multiple Positions (US) - A...
Job Description: Sales Specialist - Retail Customer Service and Sales Transform Apple Store visitors into loyal Apple customers. When customers enter the store, Read more
Position Opening at *Apple* - Apple (United...
…customers purchase our products, you're the one who helps them get more out of their new Apple technology. Your day in the Apple Store is filled with a range of Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.