Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Alternative Return Types


2 replies to this topic

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 29 August 2002 - 04:54

Twice now I've tried to have alternative return types (non-NUMBER) for my local functions and twice I've failed to successfully do so. :angry:

Given that, here's a copy of what I'm doing:
Code Sample
 prototype STRING GetTimeStamp();

function GetTimeStamp()
 STRING szDate, szTime, szTimeStamp;
begin
 GetSystemInfo(DATE, nResult, szDate);
 GetSystemInfo(TIME, nResult, szTime);
 szTimeStamp = szDate+" at "+szTime;
 return szTimeStamp;
end;


The compile error I get is " ... 'GetTimeStamp' : return type mismatch with prototype".  How come though?  The declaration says STRING and the return is type STRING, so what gives? ???

I'd appreciate some assistance here in resolving this problem.  In the meantime, I'm gonna cop out and just make it a parameter as I did the last time.
user posted image

EberhardH

EberhardH
  • Members
  • 137 posts

Posted 29 August 2002 - 06:46

Hello TacoBell00,

already tried with

        function STRING GetTimeStamp()
        begin  . . .
        end;

??
Since InstallShield definitely expects the function to name the same return type as your prototype does.

Eberhard

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 29 August 2002 - 13:42

Ah yes that did it and that assumption is backed up by the "Building a function" help topic.  Thanks.

For some reason I didn't think about trying that, but it makes sense.
user posted image