2
VladD2 от Отсталого фоксиста
VD>Особенно там хороши два последних Q&A. Первое просто фактом своего появления
>(забавно было бы посмотреть на переполох если такой Q появился бы в VC, VB или тем более в Офисе)
Это из-за вот таких Владов, раскачивающих лодку и вносящих смуту задаются ПОСТОЯННО такие вопросы.
Поэтому это и попало в FAQ. Цитиурю тебе твою же цитату Дроздова:
>это не ново... ибо хоронить Фокса начали как только он попал в Microsoft...
Как видишь, похоронить фокс — это не твоя гениальная идея. На этот раз не ты лучший.
И даже не первый. Были уже Влады и до тебя
> Ну, что же. Похвально что ты хотя бы не прячешся под анонимом называя других болтунами.
> Ну, а не понимание того что Фокс "спускают на тормозах" рано или поздно пройдет.
Вот так вот, по-отцовски... "Похвально... Пройдет, сынок... пройдет".
Это ты еще с одним фоксовским гуру разговаривал. Это я тебе просто так, для справки, всё равно, как я вижу,
тебе чужие заслуги до одного места. Только ты самый из самых. Наглость твоя беспредельна
V>>Относительно взаимодействия новых версий с MS .NET можно посмотреть наример здесь:
V>>- http://www.gotdotnet.com/team/vfp/
VD>Вот на этой страничке (что приведена выше) есть замечательная штука "Visual FoxPro Toolkit for .NET".
>Сдается мне, что лучшим выходом для всех приверженцев Фокса было бы использование ее совместно
> с освоением одним из языков дотнета. Это позволило бы и не отстать от жизни и переучиваться по-минимуму.
Мало ли что тебе сдается. Ты сам её видел? Скачай исходники этого фуфла и посмотри как одна команда VFP
достигается толпой строк кода в дотнете! Какие тут нафиг могут быть скорости, даже с твоей супер-пупер
оптимизацией под Логхорн? Ладно чёрт с ней со всякой обслугой типа стринговских функций.
Самое главное в фоксе — работа с данными. В модуле Data всего 33 функции. А остальное где?
Где несколько сотен команд/функций по обработке данных? Руками писать, чтобы достигнуть
того же функционала? По десятку строк всесто нескольких букв? Круто, ничего не скажешь...
Фокс:
Returns a logical value that indicates whether the current record is marked for deletion.
DELETED([cTableAlias | nWorkArea])
Дотнет:
/// <summary>
/// Receives a ReturnField, SearchExpression and field to be searched a as parameters. The function
/// looks up a value and returns the value of the ReturnField on a successful
/// search. The function maintains the last Order() of the view.
/// Please note that unlike the VFP Lookup() command this one receives the ReturnField and SearchField as strings.
/// </summary>
/// <example>
/// string cCustomer = vfpData.Lookup("cname", "60", "iid", oView)
/// </example>
/// <param name="tcReturnField"></param>
/// <param name="tcSearchExpression"></param>
/// <param name="tcSearchedField"></param>
/// <returns></returns>
public static string Lookup(string tcReturnField, string tcSearchExpression, string tcSearchedField, System.Data.DataView toView)
{
string cRetVal = "";
//Capture the current order
string cOrder = vfpData.Order(toView);
try
{
//Set the order to the search order
vfpData.SetOrderTo(tcSearchedField, toView);
int nFoundRec = vfpData.Seek(tcSearchExpression, toView);
//If we find a record then get the return value
if(nFoundRec != -1)
{
cRetVal = toView.Table.Rows[nFoundRec][tcReturnField].ToString();
vfpData._Found = true;
}
}
finally
{
//Cleanup to reset the old order
toView.Sort = cOrder;
}
return cRetVal;
}
public static string Lookup(string tcReturnField, string tcSearchExpression, string tcSearchedField){return vfpData.Lookup(tcReturnField, tcSearchExpression, tcSearchedField, vfpData.oView);}
Фокс:Searches a table for the first record with a field matching the specified expression.
LOOKUP(ReturnField, eSearchExpression, SearchedField [, cTagName])
Дотнет:
/// <summary>
/// Receives a record number and DataView as parameters and specifies if that
/// record is marked as deleted in the DataView
/// </summary>
/// <param name="nRecNo"></param>
/// <param name="toView"></param>
/// <returns></returns>
public static bool Deleted(int nRecNo, System.Data.DataView toView)
{
bool llRetVal = false;
//Store the current state of filter
DataViewRowState loCurrentState = toView.RowStateFilter;
toView.RowStateFilter = System.Data.DataViewRowState.Deleted;
llRetVal = (toView.Table.Rows[nRecNo].RowState.ToString() == "Deleted");
//reset to original state of filter
toView.RowStateFilter = loCurrentState;
return llRetVal;
}
public static bool Deleted(int nRecNo){return Deleted(nRecNo, vfpData.oView);}
Фокс:
Counts table records.
COUNT [Scope] [FOR lExpression1] [WHILE lExpression2] [TO VarName]
[NOOPTIMIZE]
Дотнет:
/// Returns the number of records in the DataView. If a filter condition is passed
/// as a parameter, the function returns the count for that condition
/// </summary>
/// <param name="FilterCondition"></param>
/// <returns></returns>
public static int Count(string tcFilterCondition, System.Data.DataView toView)
{
int nRetVal = 0;
//Store the current filter condition
string cCurrentFilter = toView.RowFilter;
toView.RowFilter = tcFilterCondition;
nRetVal = toView.Count;
toView.RowFilter = cCurrentFilter;
return nRetVal;
}
public static int Count(string tcFilterCondition){return Count(tcFilterCondition, vfpData.oView);}
public static int Count(System.Data.DataView toView){return toView.Count;}
public static int Count(){return vfpData.oView.Count;}
И это наше светлое будущее?