× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re:
  • From: "Eugene Astanovsky" <jevgeni@xxxxxxxxx>
  • Date: Wed, 21 Jun 2000 10:29:05 +0300
  • Organization: Estonian Optiva Bank

Title: RE:
 
----- Original Message -----
Sent: Wednesday, June 21, 2000 10:15 AM
Subject: RE:

Thanks Patrick. Now for the tricky one. I have an external DS which has fields defined in it such as CHAR MSGDTp [40] (The field is actually named MSGDT# however the interface converts the # to p to establish a correct C syntax named field). If I want to append some other string via strcpy then both fields have to be a string (according to the manual). Does this mean that I have to convert my external DS field into a string (via a locally define variable, of the same size as the MSGTp field plus 1 )?by appending a null character? And if so how do I do that? Do I have to get complicated by finding the first blank in MSGDT ( or the first non-blank from right to left, plus 1  )and then placing the null (0x00) value into that character position to turn it into a string?

 

Mike,

You cannot use str... functions on general char array fields containing data from external sources, as they never have a 0x00 in the end. The way is:

char szStr1[6];    // for a zero terminated string of 5 chars

char szResult[46]; // for the result 30+40

strcpy(szStr1, "HELLO") ;

memcpy(szResult, MSGDTp, 40) ;

memcpy(&szResult[40], szStr1, 6) ;

// szResult is a zero-terminated string.

 

 


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.