STR_LEN_STK=StrLen(Name());
STR_LEN_STK=STR_LEN_STK-7;
MOD_SYMBL_STK=StrLeft(Name(),STR_LEN_STK);

STR_LEN_FUT=StrLen(Name());
STR_LEN_FUT=STR_LEN_FUT-6;
MOD_SYMBL_FUT=StrLeft(Name(),STR_LEN_FUT);
MOD_SYMBL_FUT=MOD_SYMBL_FUT+"_SSF";

STR_LEN_IDX=StrLen(Name());
STR_LEN_IDX=STR_LEN_IDX-4;
MOD_SYMBL_IDX=StrLeft(Name(),STR_LEN_IDX);
======================================================================
==============================
The above code works as I wanted it to.

I will be very grateful if some can please check the following code and
point out the mistakes in it
======================================================================
==============================
MOD_SYMBL=
if(GroupID()==1)
{
MOD_SYMBL==MOD_SYMBL_STK
}
else if    (GroupID()==2)
{
MOD_SYMBL==MOD_SYMBL_FUT)
}
else if    (GroupID()==3)
{
MOD_SYMBL==MOD_SYMBL_IDX
}
;

---------- Forwarded message ----------
From: Rakesh Sahgal <[EMAIL PROTECTED]>
Date: Sun, Sep 7, 2008 at 12:09 PM
Subject: String manipulation function help requested
To: Amibroker Yahoogroup <[email protected]>


Hi All

I have 3 categories of symbols in my database [a] Stocks, [b] Futures and
[c] Indexes categorised as per group.

Three different operations have to be performed on the database as part of a
single scan , each operation is specific to each category of symbols. The
ticker symbol of each issue has to be modified, the modification to be done
dependent on the category of the symbol. The code for carrying out each
modification was easy and this part of the problem I have been able to
resolve.

My problem now is that I need to combine the 3 operation in a function such
that all the 3 operations can be carried out in a single scan. A simpler
method would be to write 3 scans and run each separately but that is not
convenient since I wish to run the scan during trading hours. Given my lack
of programming savvy I can only think of an "If else" kind of solution. This
will however work on 2 categories if I am not mistaken. Is it possible to
write a function which will run the operation specific to each category of
symbols  *on all the 3 categories* as part of a single scan? If so I will be
very grateful for any pointers in the right direction.

Thanks & Regards


R

Reply via email to