Delphi SynEdit无法识别列表中的所有关键字(Python)(Delphi SynEdit does not recognize all Keywords from the list (Python))
我在Delphi XE6应用程序中使用Repository中的SynEdit r117。 我想强调Python代码。
为此,我将一个SynEdit组件放在我的表单上。 另外我在其上添加了组件SynPythonSyn。 我通过Objectinspector连接它们。
现在我可以突出显示一些Python关键字。 经过几个小时的搜索,我打开了Sourcfile SynHighlighterPython.pas,它包含在SynEdit的Package ZIP中。
有一节包含python的所有关键字:
// List of keywords KEYWORDCOUNT = 29; KEYWORDS: array [1..KEYWORDCOUNT] of UnicodeString = ( 'and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'yield' );
我的问题是,“exec”是最后突出显示的关键字。 “exec”之后列表中的所有其他内容都不会突出显示。
有谁知道什么可能导致这种失败?
谢谢!
I use SynEdit r117 from the Repository in my Delphi XE6 application. I would like to highlight Python code.
For that, I placed a SynEdit Component onto my Form. Additionaly I added the Component SynPythonSyn onto it. I have connected them through the Objectinspector.
Now I am able to highlight SOME Python keywords. After a few hours of searching, I opened the Sourcfile SynHighlighterPython.pas which was included in the Package ZIP of SynEdit.
There is a section with all the Keywords of python:
// List of keywords KEYWORDCOUNT = 29; KEYWORDS: array [1..KEYWORDCOUNT] of UnicodeString = ( 'and', 'assert', 'break', 'class', 'continue', 'def', 'del', 'elif', 'else', 'except', 'exec', 'finally', 'for', 'from', 'global', 'if', 'import', 'in', 'is', 'lambda', 'not', 'or', 'pass', 'print', 'raise', 'return', 'try', 'while', 'yield' );
My problem is, that "exec" is the last highlighted keyword. All other in the list after "exec" will not be highlighted.
Does anyone have any idea what could cause this failure?
Thank you!
原文:https://stackoverflow.com/questions/29576141
最满意答案
这是我如何去做。 假设您使用的是A列和B列,并且数据从第2行开始。
= B2 + IF(A2 <0.1,10,IF(A2 <= 0.19,9,IF(A2 <= 0.29,8,IF(A2 <0.39,7,IF(A2 <= 0.49,6,IF(A2 < = 0.59,5,IF(A2 <= 0.69,4,IF(A2 <= 0.79,3,IF(A2 <= 0.89,2,IF(A2 <= 0.99,1))))))))))
另外值得注意的是,您说百分比将从0%到100%,但100%不是您的任何数据分支的一部分。
希望这个有效!
Here's how I would go at it. Assuming you are using columns A and B, and data starts on row2.
=B2+IF(A2<0.1,10,IF(A2<=0.19,9,IF(A2<=0.29,8,IF(A2<0.39,7,IF(A2<=0.49,6,IF(A2<=0.59,5,IF(A2<=0.69,4,IF(A2<=0.79,3,IF(A2<=0.89,2,IF(A2<=0.99,1))))))))))
Also worth noting that you stated the percentages would be from 0% to 100%, yet 100% is not part of any of your data forks.
Hope this works!
相关问答
更多-
R中百分比的格式表(Format table of percentages in R)[2022-10-29]
您可以使用表中的属性创建新矩阵,然后强制转换为data.frame。 不需要apply()循环。 as.data.frame(matrix( sprintf("%.0f%%", myTable*100), nrow(myTable), dimnames = dimnames(myTable) )) # 1 2 3 4 # 2006 20% 10% 25% 40% # 2007 10% 25% 30% 20% # 2008 25% 20% 20% 60% ... -
您可以执行以下解决方法来完成此操作: df *= 100 df = pandas.DataFrame(df, dtype=str) df += '%' ew = pandas.ExcelWriter('test.xlsx') df.to_excel(ew) ew.save() You can do the following workaround in order to accomplish this: df *= 100 df = pandas.DataFrame(df, dtype=str) df ...
-
据我所知,它将从最小小数部分等于或大于0.5%的数字中减去1。 在这种情况下,第二大数字只有0.54%,其他都有更大的数字。 例: 此外,当您的总数达到99%时,您应该选择小于0.5%的最大小数部分的值。 例: 因此,相应地创建算法。 As far as I know it will subtract 1 from the number with the smallest decimal part equal to or larger than 0,5%. In this case the second l ...
-
这是我如何去做。 假设您使用的是A列和B列,并且数据从第2行开始。 = B2 + IF(A2 <0.1,10,IF(A2 <= 0.19,9,IF(A2 <= 0.29,8,IF(A2 <0.39,7,IF(A2 <= 0.49,6,IF(A2 < = 0.59,5,IF(A2 <= 0.69,4,IF(A2 <= 0.79,3,IF(A2 <= 0.89,2,IF(A2 <= 0.99,1)))))))))) 另外值得注意的是,您说百分比将从0%到100%,但100%不是您的任何数据分支的一部分。 希望这 ...
-
您可能想要查看SUMPRODUCT。 您可以使用它来匹配一行中的多个单元格,然后将它们相加。 例如 =SUMPRODUCT((A1:A10=2011)*(H1:H10="Retail")*(I1:I10="A")*F1:F10) 只需将字母更改为与工作表匹配的字母即可。 细胞格式类型也很重要。 例如,您看到2011年未加引号,因为它存储为数字。 如果它以文本形式存储,则需要为“2011”。 F对应于您想要总计的列。 在这种情况下,它是十月专栏。 您还可以添加更多条件或减去它。 您还可以在开始日期之前动态添 ...
-
复杂的Excel公式(Complicated Excel Formula)[2023-06-26]
=INDEX(differentworksheet!BN4:BU143,MATCH("*"&G8&"*",differentworksheet!B4:B143,0),MATCH(D18,differentworksheet!BN4:BU4,1)) 将yourworksheet替换为您的工作表名称。 =INDEX(differentworksheet!BN4:BU143,MATCH("*"&G8&"*",differentworksheet!B4:B143,0),MATCH(D18,differentwor ... -
转换为对数域(因此您应该得到一条直线,尽管有异常值),然后应用线性回归 。 Convert to the log-domain (so that you should get a straight line, outliers notwithstanding), and then apply linear regression.
-
这没有意义 - 除非您的互联网连接一次只加载文件的1% 。 发生的事情是,在收到每个新数据包之后,它可以是基于您的下载速度的任何大小(假设介于200和230kb之间)。 每次收到其中一个时调度ProgressEvent.PROGRESS ,添加到您预期的加载总百分比。 所以基本上,假设我们正在加载一个1000kb的文件,你的下载速度是100-150kbps 。 在收到新数据包时,将在每次调度ProgressEvent.PROGRESS时调用函数中的每个trace() ,因此: 100kb装载 - 总共100 ...
-
let x->the number of 20$ tickets and y->the number of 30$ tickets then: x + y = 764 or x = 764 - y we know x*20 + y*30 = 19740 substituting (764 - y) for x (764 - y)*20 + y*30 = 19740 evaluating you get y= 446 now that we know y. x = 764 - y = 318 perce ...
-
公式将是这样的: =(Price*MinimumNights)+MAX(Booked-Accomodates,0)*ExtraPersonCharge 如果您想包括超过最少夜晚的预订,您可以使用: =(Price*MAX(Days,MinimumNights))+MAX(Booked-Accomodates,0)*ExtraPersonCharge Formula would be something like: =(Price*MinimumNights)+MAX(Booked-Accomodates ...