DateTime IRailAPI::getDateTime(String &isoTime){ String year_, month_, day_, hours_, minutes_, seconds_; int year, month, day, hours, minutes; //substrings isoTime.SubString(0, 4, year_); isoTime.SubString(5, 2, month_); isoTime.SubString(8, 2, day_); isoTime.SubString(11, 2, hours_); isoTime.SubString(14, 2, minutes_); //parsing Integer::Parse(year_, year); Integer::Parse(month_, month); Integer::Parse(day_, day); Integer::Parse(hours_, hours); Integer::Parse(minutes_, minutes); DateTime dt; dt.SetValue(year, month, day, hours, minutes); //NO NEED FOR Localisation here /* LocaleManager localeManager; localeManager.Construct(); TimeZone t= localeManager.GetSystemTimeZone(); int utcDifference = t.GetRawOffset(); dt->AddMinutes(utcDifference); */ return dt; }
unsigned LCDbWorkList::addQCRecords( LQuery qCentral, const String & barcode, int testID ) { String material = barcode.SubString( 3, 2 ); String qcLevel = barcode.SubString( 5, 1 ); const LCDbQCLevel * qc = LCDbQCLevels::records().find( material, qcLevel ); if( qc == NULL ) throw Exception( "No QC defined for " + barcode ); const LCDbProjects & pdbc = LCDbProjects::records(); const LCDbProject * qcProj = pdbc.findByName( DbFamily().getQCDb() ); LCDbWorkEntry qcEntry( barcode, qcProj -> getID(), 0, 0, 0 ); static LCDbID myLCDbID; myLCDbID.claimNextID( qCentral ); qcEntry.setGroupID( myLCDbID.getID() ); unsigned added = 0; for( Range< LCDbQCLevel::Test > tr = qc -> getTests(); tr.isValid(); ++ tr ) { if( tr -> isActive() && (testID == 0 || tr -> getTestID() == testID) && tr -> getMachineID() == LCDbAnalysers::getCurrentID() ) { LDbTestLimits noLimits( tr -> getTestID(), LCDbAnalysers::getCurrentID() ); qcEntry.setTestLimits( noLimits ); qcEntry.setDilution( tr -> getDilution() ); const LCDbTest * test = LCDbTests::records().findByID( tr -> getTestID() ); String name = (test == NULL ? String( tr -> getTestID() ) : test -> getName()); qcEntry.createRecord( qCentral, qc -> getDescription().Trim() + " " + name ); added ++; } } return added; }
void __fastcall TMatrForm::PastFromClipBrd() { TClipboard *cb = new TClipboard; TStringList *list = new TStringList; String s; int i, p, c, start, cell, col, row; TMatrix* CurMatrix; TMatrArr *grid; CurMatrix = MatrixList->Items[tc->TabIndex]; grid = CurMatrix->Grid; list->Text = cb->AsText; row = dg->Row - dg->FixedRows; for (i = 0; i < list->Count; i++) { s = list->Strings[i]; start = 1; col = dg->Col - dg->FixedCols; for (c = 1; c <= s.Length(); c++) { if (s[c] == '\t') { grid->Cells[row][col++] = s.SubString(start, c - start); start = c + 1; } if (c == s.Length()) { grid->Cells[row][col++] = s.SubString(start, c - start + 1); } } row++; } delete list; delete cb; dg->Refresh(); }
void TFileVersionInfo::SplitVersionNumber() { String version = Values[fviFileVersion]; if (version.IsEmpty()) return; version = AnsiReplaceStr(version, ",", "."); // Seperator can be ',' or '.'. int pos1 = 1; int pos2 = version.Pos("."); if (!pos2) return; FMajor = version.SubString(pos1, pos2-pos1); version = version.Delete(pos1, (pos2-pos1 +1)); pos2 = version.Pos("."); if (!pos2) return; FMinor = version.SubString(pos1, pos2-pos1); version = version.Delete(pos1, (pos2-pos1 +1)); pos2 = version.Pos("."); if (!pos2) return; FRelease = version.SubString(pos1, pos2-pos1); version = version.Delete(pos1, (pos2-pos1 +1)); FBuild = version; }
//--------------------------------------------------------------------------- void __fastcall TFormMain::ExportCFileClick(TObject *Sender) { if (ExportDialog->Execute()) { TStringList* SL = new TStringList; __try { ChangeFileExt(ExtractFileName(ExportDialog->FileName), ""); SL->Add(Format("YETI_ROM rom_map_t %s = {", ARRAYOFCONST(( ChangeFileExt(ExtractFileName(ExportDialog->FileName), ""))))); SL->Add(Format("\"%s\",\"%s\",\"%s\",{", ARRAYOFCONST(( "Test Map", "Derek J. Evans", "Welcome to Yeti3D")))); for (int y = 0; y < YETI_MAP_HEIGHT; y++) { SL->Add("{"); for (int x = 0; x < YETI_MAP_WIDTH; x++) { cell_t* cell = &yeti->cells[y][x]; SL->Add(Format("{%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d},", ARRAYOFCONST(( cell->swi, cell->ent, cell->top, cell->mid, cell->bot, cell->lit, cell->wtx, cell->ttx, cell->mtx, cell->btx, 0, // Reserved 1 0 // Reserved 2 )))); } String S = SL->Strings[SL->Count - 1]; SL->Strings[SL->Count - 1] = S.SubString(1, S.Length() - 1); SL->Add("},"); } String S = SL->Strings[SL->Count - 1]; SL->Strings[SL->Count - 1] = S.SubString(1, S.Length() - 1); SL->Add("}};"); SL->SaveToFile(ExportDialog->FileName); } __finally { SL->Free(); } }
void TCreateProjectDatabase::SetDatabaseVersion( String versionString ) { int point = versionString.Pos( "." ); if( point == 0 ) { dbMajorVersion = versionString; dbMinorVersion = 0; } else { dbMajorVersion = versionString.SubString( 1, point - 1 ); dbMinorVersion = versionString.SubString( point + 1, 2 ); } }
void SocketTest::httpClientTest() { Connector connector(GetConfig()["HTTPReplyHost"]["ip"].AsString(), GetConfig()["HTTPReplyHost"]["port"].AsLong()); Socket *socket = connector.MakeSocket(); //lint !e578 assertEqual( GetConfig()["HTTPReplyHost"]["ip"].AsString(), connector.GetAddress()); assertEqual( GetConfig()["HTTPReplyHost"]["port"].AsLong(), connector.fPort); assertEqual( (long)NULL, (long)connector.fSocket); if (t_assertm( socket != NULL, (const char *)connector.GetAddress() )) { // fails without HTTP Server long socketfd = socket->GetFd(); t_assert( socketfd > 0L); // this one sets the connect timeout socket->SetTimeout(GetConfig()["GetStreamTimeout"].AsLong(5000L)); std::iostream *Ios = socket->GetStream(); t_assert( Ios != NULL); if (Ios) { String query("GET / HTTP/1.0"); String reply; long lRetCode; if (t_assertm(socket->IsReadyForWriting(GetConfig()["ReadyForWritingTimeout"].AsLong(5000L), lRetCode), TString("expected no timeout for sending http request to [") << connector.GetAddress() << ':' << connector.fPort << "]") && t_assert(lRetCode > 0)) { (*Ios) << query << std::endl << std::endl; t_assert(!!(*Ios)); // make sure Ios is valid if (t_assertm(socket->IsReadyForReading(GetConfig()["ReadyForReadingTimeout"].AsLong(5000L), lRetCode), TString("expected no timeout for reading HTTP reply [") << connector.GetAddress() << ':' << connector.fPort << "]") && t_assert(lRetCode > 0)) { (*Ios) >> reply; assertEqual( "HTTP", reply.SubString(0, 4)); // test first line of reply by http server t_assert(!!(*Ios)); } }
void ReadSource(EnumerableDictionary<CoreLib::Basic::String, CompiledShaderSource> & sources, CoreLib::Text::Parser & parser, String src) { auto getShaderSource = [&]() { auto token = parser.ReadToken(); int endPos = token.Position + 1; int brace = 0; while (endPos < src.Length() && !(src[endPos] == L'}' && brace == 0)) { if (src[endPos] == L'{') brace++; else if (src[endPos] == L'}') brace--; endPos++; } while (!parser.IsEnd() && parser.NextToken().Position != endPos) parser.ReadToken(); parser.ReadToken(); return src.SubString(token.Position + 1, endPos - token.Position - 1); }; while (!parser.IsEnd() && !parser.LookAhead(L"}")) { auto worldName = parser.ReadWord(); CompiledShaderSource compiledSrc; compiledSrc.ParseFromGLSL(getShaderSource()); sources[worldName] = compiledSrc; } }
UriHostNameType::Type Uri::HostNameType(const String& Name) { if (RF_Net::IPAddress::IsValidIPv4(Name)) return UriHostNameType::IPv4; //check if hostname if (Name.Length()<=255)//only a max length of 255 character is allowed { UInt32 i=0; for (;i<Name.Length();++i) if ((Name[i]>='A' && Name[i]<='Z') || (Name[i]>='a' && Name[i]<='z') || (Name[i]>='0' && Name[i]<='9') || Name[i]=='-') continue; else/*Check if current char is a dot, prev,next, char isn't a dot and current char isn't first or last char of string.*/ if (Name[i]=='.' && i!=0 && i!=Name.Length()-1 && Name[i+1]!='.') continue; else break; if (i==Name.Length()) return UriHostNameType::DomainName; } if (Name.Length()>3 && Name[0]=='[' && Name[Name.Length()-1]==']') if (RF_Net::IPAddress::IsValidIPv6(Name.SubString(1,Name.Length()-2))) return UriHostNameType::IPv6; return UriHostNameType::Unknown; }
String LBDbWorkList::rootString( const String & pattern ) { if( pattern.Length() > 8 && pattern[ 1 ] == 'Q' && pattern[ 2 ] == 'C' ) return pattern.SubString( 1, 8 ); else return pattern; }
void __fastcall TMainForm::SchoolCodeMaskEditChange(TObject *Sender) { String chars = "0123456789"; TMaskEdit *me = (TMaskEdit*)Sender; char *c; int i, carPos; String s = me->Text; carPos = me->SelStart; for (i = 1; i <= s.Length(); i++) { if (!chars.Pos(s[i])) { s.Delete(i, 1); carPos--; Beep(); } } if (s.Length() > 6) { s = s.SubString(1, 6); Beep(); } me->Text = s; me->SelStart = carPos; // c = }
void FromString<String>::Function(String& out, String& value, const String& string) { if (string.StartsWith('"')) { for (std::size_t i = 1; i < string.Length(); ++i) { if (string[i] == '"') { out = string.SubString(i + 1); return; } else { value += string[i]; } } // We've reached the end of the String out = ""; } else { value = ""; out = string; } }
void Compass::Run(const String& command) { if (!command.IsEmpty()) { String args; String delim(L"/"); command.SubString(String(L"gap://").GetLength(), args); StringTokenizer strTok(args, delim); if(strTok.GetTokenCount() < 2) { AppLogDebug("Not Enough Params"); return; } String method; strTok.GetNextToken(method); // Getting callbackId strTok.GetNextToken(callbackId); AppLogDebug("Method %S, callbackId: %S", method.GetPointer(), callbackId.GetPointer()); // used to determine callback ID if(method == L"com.phonegap.Compass.watchHeading" && !callbackId.IsEmpty() && !IsStarted()) { AppLogDebug("watching compass..."); StartSensor(); } if(method == L"com.phonegap.Compass.clearWatch" && !callbackId.IsEmpty() && IsStarted()) { AppLogDebug("stop watching compass..."); StopSensor(); } if(method == L"com.phonegap.Compass.getCurrentHeading" && !callbackId.IsEmpty() && !IsStarted()) { AppLogDebug("getting current compass..."); GetLastHeading(); } AppLogDebug("Compass command %S completed", command.GetPointer()); } else { AppLogDebug("Can't run empty command"); } }
void __fastcall TForm1::FileOpen1Accept(TObject *Sender) { String a = FileOpen1->Dialog->FileName; if (a!=""){ // Öffnen if (ExtractFileExt(a).UpperCase()!=".AD")a=a.SubString(1,a.Length()-ExtractFileExt(a).Length())+".ad"; TStringList *Liste = new TStringList(); Liste->LoadFromFile(a); Max = StrToInt(Liste->Strings[0]); Edit1->Text=Liste->Strings[1]; ListBox1->Clear(); Liste->Delete(0); Liste->Delete(0); for (int i=0;i<Max;i++){ ListBox1->Items->Add(Liste->Strings[i*67]); for (int b=0;b<66;b++){ Data[i][b] = StrToInt(Liste->Strings[i*67 + b + 1]); } } ListBox1->ItemIndex=0; Selected = ListBox1->ItemIndex; Load_Dat(Selected); } }
String TForm3::Format(String s) { if (s.Trim()=="") {return s;} int length=LE->Text.Length(); //1 произвести замены bool replace=false; for (int i=1; i<SG->RowCount-1&&!replace; i++) { String r=Replace(s,SG->Cells[0][i],SG->Cells[1][i]); if (s!=r) { replace=true; s=r; } } if (replace) { s=Replace(s,".",""); s=Replace(s,"-",""); s=Replace(s,",",""); s=Replace(s,":",""); //2 форматировать как на образце int k=0; for (int i=1; i<=length; i++) { if (LE->Text.SubString(i,1)!="_") { s.Insert(LE->Text.SubString(i,1),i+k); //k++; } } } return s.SubString(1,length); }
Ptr<Mesh> Mesh::AssimpLoader::Load(const String& path) { auto exceptionManager = ExceptionManager::GetInstance(); this->path = &path; this->dir = path.SubString(0, path.LastIndexOf(TEXT('/'))); Assimp::Importer importer; const aiScene* aiscene = importer.ReadFile(path.ToStdString(), aiProcess_MakeLeftHanded | aiProcess_Triangulate | aiProcess_CalcTangentSpace | aiProcess_GenNormals | aiProcess_ValidateDataStructure | aiProcess_ImproveCacheLocality | aiProcess_RemoveRedundantMaterials | aiProcess_FindDegenerates | aiProcess_SortByPType | aiProcess_FindInvalidData | aiProcess_GenUVCoords | aiProcess_TransformUVCoords | aiProcess_OptimizeMeshes | aiProcess_FixInfacingNormals | aiProcess_JoinIdenticalVertices | aiProcess_PreTransformVertices); if (aiscene == nullptr) { exceptionManager->PushException(Ptr<Exception>::New(aiGetErrorString())); return nullptr; } Ptr<Mesh> mesh = this->LoadAssimpNode(aiscene->mRootNode, aiscene); if (mesh == nullptr) return nullptr; mesh->filePath = path; return mesh; }
//--------------------------------------------------------------------------- void __fastcall TChangePasswordFrom::cxButton1Click(TObject *Sender) { String Oldpwstr = TEOldPassword->Text; String Newpwstr1 = TENewPassword1->Text; String Newpwstr2 = TENewPassword2->Text; if("" != Oldpwstr) { if(("" != Newpwstr1)&&("" != Newpwstr2)) { if(Newpwstr1 == Newpwstr2) { ADOQuery1->Close(); ADOQuery1->SQL->Clear(); ADOQuery1->SQL->Add("Select * from XTSET"); ADOQuery1->Open(); String tmpstr = ADOQuery1->FieldByName("DWMM")->AsString; //ShowMessage(tmpstr); if(tmpstr == Oldpwstr) { if(Newpwstr1 == Newpwstr2) { if(4 == Newpwstr1.Length()) { ADOQuery1->Edit(); ADOQuery1->FieldByName("DWMM")->AsString = Newpwstr1; ADOQuery1->Post(); String tmpDWPassword = ADOQuery1->FieldByName("DWMM")->AsAnsiString.Trim(); for(int t=0; t < 2; t++) { int tmpint = StrToInt("0x"+tmpDWPassword.SubString(t*2+1, 2)); IntToUChar(tmpint, &DWPassword[t]); } MessageBox(this->Handle, "密码修改成功!", "成功", MB_OK|MB_ICONEXCLAMATION); this->Close(); } else MessageBox(this->Handle, "密码必须为4位!", "错误", MB_OK|MB_ICONERROR); } else MessageBox(this->Handle, "请输入两次相同的新密码!", "错误", MB_OK|MB_ICONERROR); } else { MessageBox(this->Handle, "旧密码错误!", "错误", MB_OK|MB_ICONERROR); } ADOQuery1->Close(); } else { // ShowMessage("两次输入的密码不一致!"); MessageBox(this->Handle, "两次输入的密码不一致!", "错误", MB_OK|MB_ICONERROR); } } } else MessageBox(this->Handle, "旧密码不为空!", "错误", MB_OK|MB_ICONERROR); }
void Network::Run(const String& command) { if (!command.IsEmpty()) { String args; String delim(L"/"); command.SubString(String(L"gap://").GetLength(), args); StringTokenizer strTok(args, delim); if(strTok.GetTokenCount() < 3) { AppLogDebug("Not enough params"); return; } String method; String hostAddr; strTok.GetNextToken(method); strTok.GetNextToken(callbackId); strTok.GetNextToken(hostAddr); // URL decoding Uri uri; uri.SetUri(hostAddr); AppLogDebug("Method %S, callbackId %S, hostAddr %S URI %S", method.GetPointer(), callbackId.GetPointer(), hostAddr.GetPointer(), uri.ToString().GetPointer()); if(method == L"org.apache.cordova.Network.isReachable") { IsReachable(uri.ToString()); } AppLogDebug("Network command %S completed", command.GetPointer()); } else { AppLogDebug("Can't run empty command"); } }
String Path::TruncateExt(const String & path) { int dotPos = path.LastIndexOf('.'); if (dotPos != -1) return path.SubString(0, dotPos); else return path; }
String Path::GetFileExt(const String & path) { int dotPos = path.LastIndexOf('.'); if (dotPos != -1) return path.SubString(dotPos+1, path.Length()-dotPos-1); else return ""; }
void __fastcall TSectionInfoManageFRM::cxButton2Click(TObject *Sender) { if((!cxTextEdit6->Text.IsEmpty())&&(!cxTextEdit14->Text.IsEmpty())&&(-1 != cxComboBox1->ItemIndex)) { USERADOQ->Close(); String checksqlstr = "select * from SYSUSER where USERNAME='******'"; USERADOQ->SQL->Clear(); USERADOQ->SQL->Add(checksqlstr); USERADOQ->Open(); if(!USERADOQ->IsEmpty()) { ShowMessage("该用户名已经存在,请更换!"); USERADOQ->Close(); return; } USERADOQ->Close(); if(cxTextEdit14->Text.IsEmpty()||(8!=cxTextEdit14->Text.Length())) { ShowMessage("密码不能为空,且密码长度必须为8位!"); return; } char OLPW[8]; char ENPW[9]; ZeroMemory(OLPW, 8); ZeroMemory(ENPW, 9); String tmppwstr = cxTextEdit14->Text; for(int i=0; i<4; i++) { int tmpint = StrToInt("0x"+tmppwstr.SubString(i*2+1, 2)); IntToUChar(tmpint, &OLPW[i]); } EncrptyCardMMProc(0, OLPW, ENPW); char Inbasechar[17]; ZeroMemory(Inbasechar, 17); for(int t = 0; t<8; t++) { char tmp; tmp = ENPW[t]>>4; tmp = tmp&0x0f; if(tmp >= 10) Inbasechar[t*2] = tmp+55; if(tmp <10) Inbasechar[t*2] = tmp+48; tmp = ENPW[t]&0x0f; if(tmp >= 10) Inbasechar[t*2+1] = tmp+55; if(tmp <10) Inbasechar[t*2+1] = tmp+48; } String stortstr = Inbasechar; USERADOT->InsertRecord(ARRAYOFCONST((cxTextEdit6->Text, Inbasechar, cxComboBox1->ItemIndex+1, cxComboBox1->Text))); }
void __fastcall TForm9::BitBtn2Click(TObject *Sender) { if(Form38->TBdata=="5") { ShowMessage("正在同步移库数据"); return; } BitBtn1Click(Sender); String Dir; if(SelectDirectory("Directory Name","",Dir)) { if(Dir.SubString(Dir.Length(),1)!="\\") { Dir=Dir+"\\"; } TStringList *SaveList=new TStringList(); int selectnum=Form1->YK_ADOQuery->RecordCount; String str=""; String FileName="移库表"; String datetime= Now().FormatString("yyyymmddhhnnss"); SaveList->Text=""; for(int i=0;i<selectnum;i++) { str=""; // RK_Grid->Columns->Items[0]->Field-> str="YK,"+ Form1->YK_ADOQuery->FieldByName("条码")->AsString+","+ Form1->YK_ADOQuery->FieldByName("名称")->AsString+","+ Form1->YK_ADOQuery->FieldByName("货号")->AsString+","+ Form1->YK_ADOQuery->FieldByName("规格")->AsString+","+ Form1->YK_ADOQuery->FieldByName("型号")->AsString+","; if(Form1->Pshow=="show")str+=Form1->YK_ADOQuery->FieldByName("进价")->AsString+","; str+=Form1->YK_ADOQuery->FieldByName("售价")->AsString+","+ Form1->YK_ADOQuery->FieldByName("单位")->AsString+","+ Form1->YK_ADOQuery->FieldByName("备注一")->AsString+","+ Form1->YK_ADOQuery->FieldByName("备注二")->AsString+","+ Form1->YK_ADOQuery->FieldByName("备注三")->AsString+","+ Form1->YK_ADOQuery->FieldByName("原仓库")->AsString+","+ Form1->YK_ADOQuery->FieldByName("目的仓库")->AsString+","+ Form1->YK_ADOQuery->FieldByName("数量")->AsString+","+ Form1->YK_ADOQuery->FieldByName("移库时间")->AsString+","+ Form1->YK_ADOQuery->FieldByName("员工编号")->AsString+","+ Form1->YK_ADOQuery->FieldByName("员工姓名")->AsString; SaveList->Add(str); Form1->YK_ADOQuery->Next(); } Form1->SaveExcel(SaveList,Dir.Trim()+FileName+"-"+datetime+".xls") ; MessageDlg("导出完成",mtInformation,TMsgDlgButtons()<<mbOK,0); delete SaveList; } else return; }
String Path::GetDirectoryName(const String & path) { int pos = path.LastIndexOf('/'); pos = Math::Max(path.LastIndexOf('\\'), pos); if (pos != -1) return path.SubString(0, pos); else return ""; }
String Path::GetFileNameWithoutEXT(const String & path) { int pos = path.LastIndexOf('/'); pos = Math::Max(path.LastIndexOf('\\'), pos) + 1; int dotPos = path.LastIndexOf('.'); if (dotPos <= pos) dotPos = path.Length(); return path.SubString(pos, dotPos - pos); }
//--------------------------------------------------------------------------- String __fastcall TMyRCVersion::GetMajorVersion( void ) { String s = GetFileVersion(); // s = major.minor.release.build int n = s.Pos( '.' ); if ( n ) return s.SubString( 1, n - 1 ); return s; }
::Move Parser::getMove(String move) { TStringList *tmpArgs = new TStringList(); tmpArgs->Delimiter = ','; tmpArgs->DelimitedText = move.SubString(move.Pos("(")+1,move.Pos(")")-move.Pos("(") - 1); ::Move tmpMove(tmpArgs->Strings[0],tmpArgs->Strings[1],tmpArgs->Strings[2]); tmpArgs->Free(); return tmpMove; }
CD_Time::CD_Time(String TimeStr) { size_t delim_pos=TimeStr.Pos(":"); hours=(unsigned short)(TimeStr.SubString(1,delim_pos-1).ToIntDef(0)); minits=(BYTE)(TimeStr.SubString(delim_pos+1,TimeStr.Length()-delim_pos).ToIntDef(0)); if (minits>=60) { hours++; minits-=60; } if (hours>9999) { hours=0; minits=0; } time_string=(String)hours+":"+(String)minits; msek=(hours*60+minits)*60*1000; }
String Uri::EscapeUriString(const String& StringToEscape) { String str; for (UInt32 i=0;i<StringToEscape.Length();++i) if (NeedToEscapeUriChar[static_cast<UInt8>(StringToEscape[i])]) str+=HexEscape(StringToEscape[i]); else str+=StringToEscape.SubString(i,1); return str; }
void TPropertyHandler::SetNameValue(TComponent* comp, String prName_Value) { if (prName_Value.LastDelimiter("\r\n")) { // Multi-line string, so call SetNamesValues(): SetNamesValues(comp, prName_Value); return; } String name2, name1, value; // Reads like this: "name2.name1=value". int sep = prName_Value.Pos("="); String names = prName_Value.SubString(1, sep - 1); value = prName_Value.SubString(sep + 1, prName_Value.Length() - sep + 1); sep = names.Pos("."); if (sep) { // Format is "propname.subprop=val": name1 = names.SubString(sep + 1, names.Length() - sep + 1); name2 = names.SubString(1, sep - 1); // name2 is the subcomp of comp. if (!IsPublishedProp(comp, name2)) // No warning. { /* name2 is not a component of comp, but it might be a component of its own, like CheckBox1 is a sub-component of Form1. */ if ((comp = GetSubComponent(comp, name2)) == NULL) return; else { SetPropValue(comp, name1, value); return; } } if (!IsClass(comp, name2)) return; // Get pointer to subObj: TObject *subObj = (TObject *)GetOrdProp(comp, name2); if (subObj == NULL) return; SetPropValue(subObj, name1, value); } else { // Format is "propname=val": SetPropValue(comp, names, value); } }
//--------------------------------------------------------------------------- String __fastcall TMyRCVersion::GetMinorVersion( void ) { String s = GetFileVersion(); int nStart = s.Pos( '.' ); if ( !nStart ) return s; s[ nStart ] = ' '; int nEnd = s.Pos( '.' ); return s.SubString( nStart + 1, nEnd - 1 - nStart ); }