<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><blockquote type="cite"><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>On Sep 5, 2010, at 6:00 AM, <a href="mailto:openbios-request@openbios.org">openbios-request@openbios.org</a> wrote:<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>On 9/1/10 4:57 PM, Programmingkid wrote:<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>On Sep 1, 2010, at 6:00 AM, <a href="mailto:openbios-request@openbios.org">openbios-request@openbios.org</a><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><<a href="mailto:openbios-request@openbios.org">mailto:openbios-request@openbios.org</a>> wrote:<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Message: 5<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Date: Tue, 31 Aug 2010 20:11:30 -0400<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>From: Tarl Neustaedter <<a href="mailto:tarl-b2@tarl.net">tarl-b2@tarl.net</a> <<a href="mailto:tarl-b2@tarl.net">mailto:tarl-b2@tarl.net</a>>><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>To: The OpenBIOS Mailinglist <<a href="mailto:openbios@openbios.org">openbios@openbios.org</a><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><<a href="mailto:openbios@openbios.org">mailto:openbios@openbios.org</a>>><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Subject: Re: [OpenBIOS] Concatenating strings<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Message-ID: <<a href="mailto:4C7D9A32.2070300@tarl.net">4C7D9A32.2070300@tarl.net</a><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><<a href="mailto:4C7D9A32.2070300@tarl.net">mailto:4C7D9A32.2070300@tarl.net</a>>><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>On 2010-8-31 8:06 PM, Programmingkid wrote:<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Could someone provide me with a code example on how to combine two<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>strings <br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>together in forth please. Here is my attempt. For some reason it<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>doesn't <br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>work. Any help would be great.<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>The below takes two strings of the form (addr len), allocates a chunk of <br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>memory for them, and concatenates them into that allocated memory,<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>returning <br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>addr len.<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>: $cat2  ( $1 $2 -- $3 )<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>  2 pick over +  dup >r alloc-mem >r<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>  2swap tuck  r@ swap move           ( $2 $1-len )<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>  r@ + swap move                     ( )<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>  r> r><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>;<br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Thank you very much Tarl. This word should be added to OpenBIOS. <br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote><br><blockquote class="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: none; padding: 0px;"></blockquote>Please make sure whether the already existing functions (ie. in<br><div>openbios/forth/lib/string.fs) work for you before adding new stuff.</div></blockquote><div></div><blockquote type="cite"><div><br></div><div>Stefan</div></blockquote><div><br></div><div>Sorry Stefan, but the words there are not very useful. $cat looks a lot more useful and user-friendly than tmpstrcat. Adding $cat to string.fs would make an excellent addition the OpenBIOS. </div></body></html>