🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15455

Concatenation and function declaration syntax

#15455
From: pierugg
Date: Sat, 28 Jun 2003 17:39
41 lines
2240 bytes
Hi all,

i got two questions, first when a function needs a string as argument and in
my app the string is made up of two strings how can i pass the two of them
as argument?
Example:
i got two strings driveletter and path
if I want to call directoryexists in vb i do Directoryexists(driveletter &
path). i think the & is called concatenation operator or something like
that, vb's is & and php's is "." , does c++ have one? Or do i have to use
concatenate() ?

2nd question, i declared a function "void RunApp(char *slFileName);" outside
of all other functions, with the includes and then I have my function
"void RunApp(char *slFileName) {
  int slResuslt = int(ShellExecute(0, "open", slFileName,0, 0,
SW_SHOWNORMAL));

  if(slResuslt <= 32)
  {
    AnsiString slMessage;
    slMessage = "Error: could not execute program!";
    Application -> MessageBox(slMessage.c_str(), "Error!",MB_OK +
MB_ICONEXCLAMATION);
  }
}"


and I get these errors: "[C++ Error] MainKatapult.cpp(64): E2141 Declaration
syntax error." for line 2 ( the "{"  )
and "[C++ Error] MainKatapult.cpp(80): E2139 Declaration missing ;.
[C++ Error] MainKatapult.cpp(80): E2134 Compound statement missing }.
[C++ Error] MainKatapult.cpp(80): E2134 Compound statement missing }."

for the line after the final "}"

I really don't see why, does anyone?

thanks

pierugg
Technical Details
Message-ID: <3efdd01f@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,34d3af52a8f23dc8,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-28 10:36:01 PST
From: "pierugg" <pierugg@kana.fr.st>
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Concatenation and function declaration syntax
Date: Sat, 28 Jun 2003 19:39:20 +0200
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.00.2615.200
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200
NNTP-Posting-Host: 81.56.19.39
Message-ID: <3efdd01f@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1056821279 81.56.19.39 (28 Jun 2003 10:27:59 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail