Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

trasmit

Status
Not open for further replies.

efittery

Programmer
Joined
Feb 13, 2003
Messages
21
Location
US
I use the following to erase a sector of flash memory:

proc eraseFlash

; Erases the target FlASH Sector

param integer sectorAddress

string sectorAddress_string

itoa sectorAddress sectorAddress_string ; convert for "transmit"

transmit "FLASH_SECTOR_ERASE "
transmit sectorAddress_string
transmit " ^M"

endproc

Is there a way to use "transmit" to send the string:

FLASH_SECTOR_ERASE sectorAddress_string

without using "transmit" 3 times?

thanks
 
You can use the strfmt command to create the string, and then use transmit once to send the completed string. This should do the trick:

strfmt sFlashErase "FLASH_SECTOR_ERASE %s^M" sectorAddress_string
transmit sFlashErase

This would require that you declare a string variable named sFlashErase (or whatever name you feel appropriate) in your script.
aspect@aspectscripting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top